home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / mail / elm / elm2.4.p23b.Z / elm2.4.p23b
Encoding:
Text File  |  1993-09-26  |  84.2 KB  |  2,695 lines

  1. Subject: elm 2.4 Patch #23b
  2. Summary: This is an official patch for elm 2.4 system.  Please apply it.
  3. Priority: HIGH
  4.  
  5. THIS IS PART 2 OF A 5 PART PATCH
  6.  
  7. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your elm source
  8.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  9.     If you don't have the patch program, apply the following by hand,
  10.     or get patch (version 2.0, latest patchlevel).
  11.  
  12.     After patching:
  13.         Apply patchs 23c, 23d, 23e next
  14.  
  15.     If patch indicates that patchlevel is the wrong version, you may need
  16.     to apply one or more previous patches, or the patch may already
  17.     have been applied.  See the patchlevel.h file to find out what has or
  18.     has not been applied.  In any event, don't continue with the patch.
  19.  
  20.     If you are missing previous patches they can be obtained from our:
  21.     archive server.
  22.  
  23.     Syd Weinstein
  24.     elm@DSI.COM
  25.  
  26.     The patches are available from the dsinc archive server
  27.     Send the following message to archive-server@DSI.COM for
  28.     a list of available patches:
  29.  
  30.     Subject: patch list
  31.     send index elm
  32.  
  33. Index: hdrs/defs.h
  34. Prereq: 5.27
  35. *** ../elm2.4/hdrs/defs.h    Sat May  8 15:41:18 1993
  36. --- hdrs/defs.h    Sun Sep 19 19:41:00 1993
  37. ***************
  38. *** 1,8 ****
  39.   
  40. ! /* $Id: defs.h,v 5.27 1993/05/08 19:41:13 syd Exp $ */
  41.   
  42.   /*******************************************************************************
  43. !  *  The Elm Mail System  -  $Revision: 5.27 $   $State: Exp $
  44.    *
  45.    *             Copyright (c) 1988-1992 USENET Community Trust
  46.    *             Copyright (c) 1986,1987 Dave Taylor
  47. --- 1,8 ----
  48.   
  49. ! /* $Id: defs.h,v 5.33 1993/09/19 23:40:48 syd Exp $ */
  50.   
  51.   /*******************************************************************************
  52. !  *  The Elm Mail System  -  $Revision: 5.33 $   $State: Exp $
  53.    *
  54.    *             Copyright (c) 1988-1992 USENET Community Trust
  55.    *             Copyright (c) 1986,1987 Dave Taylor
  56. ***************
  57. *** 14,19 ****
  58. --- 14,59 ----
  59.    *
  60.    *******************************************************************************
  61.    * $Log: defs.h,v $
  62. +  * Revision 5.33  1993/09/19  23:40:48  syd
  63. +  * Defince SEEK_SET in one of our headers as a last resort
  64. +  * From: Syd
  65. +  *
  66. +  * Revision 5.32  1993/08/23  02:46:51  syd
  67. +  * Test ANSI_C, not __STDC__ (which is not set on e.g. AIX).
  68. +  * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
  69. +  *
  70. +  * Revision 5.31  1993/08/23  02:45:29  syd
  71. +  * The macro ctrl(c) did not work correctly for a DEL character
  72. +  * neither did it make the backward mapping from a control char
  73. +  * to the letter that is normally used with an up-arrow prefix
  74. +  * to represent the control character.
  75. +  * From: Jukka Ukkonen <ukkonen@csc.fi>
  76. +  *
  77. +  * Revision 5.30  1993/08/03  19:28:39  syd
  78. +  * Elm tries to replace the system toupper() and tolower() on current
  79. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  80. +  * collide during linking with routines in isctype.o.  This patch adds
  81. +  * a Configure test to determine whether replacements are really needed
  82. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  83. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  84. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  85. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  86. +  * were dropped.
  87. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  88. +  *
  89. +  * Revision 5.29  1993/08/03  19:05:33  syd
  90. +  * When STDC is used on Convex the feof() function is defined as
  91. +  * a true library routine in the header files and moreover the
  92. +  * library routine also leaks royally. It returns always 1!!
  93. +  * So we have to use a macro. Convex naturally does not provide
  94. +  * you with one though if you are using a STDC compiler. So we
  95. +  * have to include one.
  96. +  * From: Jukka Ukkonen <ukkonen@csc.fi>
  97. +  *
  98. +  * Revision 5.28  1993/07/20  02:59:53  syd
  99. +  * Support aliases both on 64 bit and 32 bit machines at the same time.
  100. +  * From: Dan Mosedale <mosedale@genome.stanford.edu>
  101. +  *
  102.    * Revision 5.27  1993/05/08  19:41:13  syd
  103.    * make it now depend on mallocvoid
  104.    *
  105. ***************
  106. *** 138,143 ****
  107. --- 178,184 ----
  108.   
  109.   
  110.   #include <sys/types.h>    /* for fundamental types */
  111. + #include <stdio.h>    /* Must get the _IOEOF flag for feof() on Convex */
  112.   #include "../config.h"
  113.   #include "sysdefs.h"    /* system/configurable defines */
  114.   
  115. ***************
  116. *** 311,318 ****
  117.   #define DECEMBER    11
  118.   
  119.   #define equal(s,w)    (strcmp(s,w) == 0)
  120. ! #define min(a,b)    a < b? a : b
  121. ! #define ctrl(c)            c - 'A' + 1    /* control character mapping */
  122.   #define plural(n)    n == 1 ? "" : "s"
  123.   #define lastch(s)    s[strlen(s)-1]
  124.   #define ifmain(a,b)    (inalias ? b : a)
  125. --- 352,367 ----
  126.   #define DECEMBER    11
  127.   
  128.   #define equal(s,w)    (strcmp(s,w) == 0)
  129. ! #define min(a,b)    (a) < (b) ? (a) : (b)
  130. ! /*
  131. !  *  Control character mapping like "c - 'A' + 1" does not work
  132. !  *  correctly for a DEL. Neither does it allow mapping from
  133. !  *  a control character to the letter that is normally used with
  134. !  *  an up-arrow prefix to represent the control char.
  135. !  *  The correct mapping should be done like this...
  136. !  */
  137. ! #define ctrl(c)            (((c) + '@') & 0x7f)
  138.   #define plural(n)    n == 1 ? "" : "s"
  139.   #define lastch(s)    s[strlen(s)-1]
  140.   #define ifmain(a,b)    (inalias ? b : a)
  141. ***************
  142. *** 482,487 ****
  143. --- 531,553 ----
  144.       char mailx_status[WLEN];/** mailx status flags (RO...)    **/
  145.          };
  146.   
  147. + #ifdef __alpha
  148. + #define int32 int
  149. + #else
  150. + #define int32 long
  151. + #endif
  152. + struct alias_disk_rec {
  153. +     int32 status;            /* DELETED, TAGGED, VISIBLE, ...     */
  154. +     int32 alias;            /* alias name                        */
  155. +     int32 last_name;        /* actual personal (last) name       */
  156. +     int32 name;            /* actual personal name (first last) */
  157. +     int32 comment;            /* comment, doesn't show in headers  */
  158. +     int32 address;            /* non expanded address              */
  159. +     int32 type;            /* mask-- sys/user, person/group     */
  160. +     int32 length;            /* length of alias data on file      */
  161. +        };
  162.   struct alias_rec {
  163.       int   status;            /* DELETED, TAGGED, VISIBLE, ...     */
  164.       char  *alias;            /* alias name                        */
  165. ***************
  166. *** 530,535 ****
  167. --- 596,615 ----
  168.   #    include <string.h>
  169.   #  endif
  170.   #endif
  171. + #ifdef    __convex__
  172. + /*
  173. +  *  Nice work Convex people! Thanks a million!
  174. +  *  When STDC is used feof() is defined as a true library routine
  175. +  *  in the header files and moreover the library routine also leaks
  176. +  *  royally. (It returns always 1!!) Consequently this macro is
  177. +  *  unavoidable.)
  178. +  */
  179. + #  ifndef   feof
  180. + #    define   feof(p)    ((p)->_flag&_IOEOF)
  181. + #  endif
  182. + #endif
  183.   #ifndef ANSI_C   /* ANSI puts these in string.h */
  184.   char *index(), *rindex(); /* names will be traslated by define in config.h */
  185.   char *strtok(), *strcpy(), *strcat(), *strncpy(); /* more in string.h in ANSI */
  186. ***************
  187. *** 573,583 ****
  188.   
  189.   #ifdef POSIX_SIGNALS
  190.   #define signal posix_signal
  191. ! #ifdef __STDC__
  192.   extern SIGHAND_TYPE (*posix_signal(int, SIGHAND_TYPE (*)(int)))(int);
  193. ! #else    /* __STDC__ */
  194.   extern SIGHAND_TYPE (*posix_signal())();
  195. ! #endif    /* __STDC__ */
  196.   #else    /* POSIX_SIGNALS */
  197.   #ifdef SIGSET
  198.   #define signal sigset
  199. --- 653,663 ----
  200.   
  201.   #ifdef POSIX_SIGNALS
  202.   #define signal posix_signal
  203. ! #if ANSI_C
  204.   extern SIGHAND_TYPE (*posix_signal(int, SIGHAND_TYPE (*)(int)))(int);
  205. ! #else    /* ANSI_C */
  206.   extern SIGHAND_TYPE (*posix_signal())();
  207. ! #endif    /* ANSI_C */
  208.   #else    /* POSIX_SIGNALS */
  209.   #ifdef SIGSET
  210.   #define signal sigset
  211. ***************
  212. *** 587,592 ****
  213. --- 667,695 ----
  214.   #endif /* SIGSET */
  215.   #endif /* POSIX_SIGNALS */
  216.   
  217. + /*
  218. +  * Some of the old BSD ctype conversion macros corrupted characters.
  219. +  * We will substitute our own versions if required.
  220. +  */
  221. + #include <ctype.h>
  222. + #ifdef BROKE_CTYPE
  223. + # undef  toupper
  224. + # define toupper(c)    (islower(c) ? ((c) - 'a' + 'A') : (c))
  225. + # undef  tolower
  226. + # define tolower(c)    (isupper(c) ? ((c) - 'A' + 'a') : (c))
  227. + #endif
  228. + /*
  229. +  *    if the seek constants arent set in an include file
  230. +  *    lets define them ourselves
  231. +  */
  232. + #ifndef SEEK_SET
  233. + #define    SEEK_SET    0    /* Set file pointer to "offset" */
  234. + #define    SEEK_CUR    1    /* Set file pointer to current plus "offset" */
  235. + #define    SEEK_END    2    /* Set file pointer to EOF plus "offset" */
  236. + #endif
  237.   /*
  238.    * The "safe_malloc_fail_handler" vector points to a routine that is invoked
  239.    * if one of the safe_malloc() routines fails.  At startup, this will point
  240.  
  241. Index: hdrs/elm.h
  242. Prereq: 5.9
  243. *** ../elm2.4/hdrs/elm.h    Sat May  8 16:03:17 1993
  244. --- hdrs/elm.h    Tue Aug 10 14:49:33 1993
  245. ***************
  246. *** 1,8 ****
  247.   
  248. ! /* $Id: elm.h,v 5.9 1993/05/08 20:03:12 syd Exp $ */
  249.   
  250.   /*******************************************************************************
  251. !  *  The Elm Mail System  -  $Revision: 5.9 $   $State: Exp $
  252.    *
  253.    *             Copyright (c) 1988-1992 USENET Community Trust
  254.    *             Copyright (c) 1986,1987 Dave Taylor
  255. --- 1,8 ----
  256.   
  257. ! /* $Id: elm.h,v 5.10 1993/08/10 18:49:32 syd Exp $ */
  258.   
  259.   /*******************************************************************************
  260. !  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
  261.    *
  262.    *             Copyright (c) 1988-1992 USENET Community Trust
  263.    *             Copyright (c) 1986,1987 Dave Taylor
  264. ***************
  265. *** 14,19 ****
  266. --- 14,27 ----
  267.    *
  268.    *******************************************************************************
  269.    * $Log: elm.h,v $
  270. +  * Revision 5.10  1993/08/10  18:49:32  syd
  271. +  * When an environment variable was given as the tmpdir definition the src
  272. +  * and dest overlapped in expand_env.  This made elm produce a garbage
  273. +  * expansion because expand_env cannot cope with overlapping src and
  274. +  * dest.  I added a new variable raw_temp_dir to keep src and dest not to
  275. +  * overlap.
  276. +  * From: Jukka Ukkonen <ukkonen@csc.fi>
  277. +  *
  278.    * Revision 5.9  1993/05/08  20:03:12  syd
  279.    * add sleepmsg to list
  280.    *
  281. ***************
  282. *** 115,120 ****
  283. --- 123,129 ----
  284.   char cur_tempfolder[SLEN] = {0};/* name of temp folder open for a mailbox */
  285.   char defaultfile[SLEN] = {0};    /* name of default folder */
  286.   char temp_dir[SLEN] = {0};      /* name of temp directory */
  287. + char raw_temp_dir[SLEN] = {0};  /* unexpanded name of temp directory */
  288.   char hostname[SLEN] = {0};    /* name of machine we're on*/
  289.   char hostdomain[SLEN] = {0};    /* name of domain we're in */
  290.   char hostfullname[SLEN] = {0};    /* name of FQDN we're in */
  291.  
  292. Index: hdrs/filter.h
  293. Prereq: 5.10
  294. *** ../elm2.4/hdrs/filter.h    Sun Jun  6 14:24:47 1993
  295. --- hdrs/filter.h    Tue Aug  3 15:28:44 1993
  296. ***************
  297. *** 1,8 ****
  298.   
  299. ! /* $Id: filter.h,v 5.10 1993/06/06 17:34:40 syd Exp $ */
  300.   
  301.   /*******************************************************************************
  302. !  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
  303.    *
  304.    *             Copyright (c) 1988-1992 USENET Community Trust
  305.    *             Copyright (c) 1986,1987 Dave Taylor
  306. --- 1,8 ----
  307.   
  308. ! /* $Id: filter.h,v 5.11 1993/08/03 19:28:39 syd Exp $ */
  309.   
  310.   /*******************************************************************************
  311. !  *  The Elm Mail System  -  $Revision: 5.11 $   $State: Exp $
  312.    *
  313.    *             Copyright (c) 1988-1992 USENET Community Trust
  314.    *             Copyright (c) 1986,1987 Dave Taylor
  315. ***************
  316. *** 14,19 ****
  317. --- 14,31 ----
  318.    *
  319.    *******************************************************************************
  320.    * $Log: filter.h,v $
  321. +  * Revision 5.11  1993/08/03  19:28:39  syd
  322. +  * Elm tries to replace the system toupper() and tolower() on current
  323. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  324. +  * collide during linking with routines in isctype.o.  This patch adds
  325. +  * a Configure test to determine whether replacements are really needed
  326. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  327. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  328. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  329. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  330. +  * were dropped.
  331. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  332. +  *
  333.    * Revision 5.10  1993/06/06  17:34:40  syd
  334.    * remove useless _vbuf definition
  335.    *
  336. ***************
  337. *** 68,77 ****
  338.   
  339.   #include "regexp.h"
  340.   
  341. - #ifdef   BSD
  342. - # undef  tolower
  343. - #endif
  344.   /** define a few handy macros for later use... **/
  345.   
  346.   #define  the_same(a,b)    (strncmp(a,b,strlen(b)) == 0)
  347. --- 80,85 ----
  348.  
  349. Index: hdrs/headers.h
  350. Prereq: 5.10
  351. *** ../elm2.4/hdrs/headers.h    Sat May  8 16:03:18 1993
  352. --- hdrs/headers.h    Tue Aug 10 16:49:55 1993
  353. ***************
  354. *** 1,8 ****
  355.   
  356. ! /* $Id: headers.h,v 5.10 1993/05/08 20:03:12 syd Exp $ */
  357.   
  358.   /*******************************************************************************
  359. !  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
  360.    *
  361.    *             Copyright (c) 1988-1992 USENET Community Trust
  362.    *             Copyright (c) 1986,1987 Dave Taylor
  363. --- 1,8 ----
  364.   
  365. ! /* $Id: headers.h,v 5.11 1993/08/10 20:49:40 syd Exp $ */
  366.   
  367.   /*******************************************************************************
  368. !  *  The Elm Mail System  -  $Revision: 5.11 $   $State: Exp $
  369.    *
  370.    *             Copyright (c) 1988-1992 USENET Community Trust
  371.    *             Copyright (c) 1986,1987 Dave Taylor
  372. ***************
  373. *** 14,19 ****
  374. --- 14,22 ----
  375.    *
  376.    *******************************************************************************
  377.    * $Log: headers.h,v $
  378. +  * Revision 5.11  1993/08/10  20:49:40  syd
  379. +  * Add raw_temp_dir
  380. +  *
  381.    * Revision 5.10  1993/05/08  20:03:12  syd
  382.    * add sleepmsg to list
  383.    *
  384. ***************
  385. *** 115,120 ****
  386. --- 118,124 ----
  387.   extern char cur_tempfolder[SLEN]; /* name of temp folder open for a mailbox */
  388.   extern char defaultfile[SLEN];    /* name of default folder */
  389.   extern char temp_dir[SLEN];     /* name of temp directory */
  390. + extern char raw_temp_dir[SLEN]; /* unexpanded name of temp directory */
  391.   extern char hostname[SLEN];    /* name of machine we're on*/
  392.   extern char hostdomain[SLEN];    /* name of domain we're in */
  393.   extern char hostfullname[SLEN]; /* name of FQDN we're in */
  394.  
  395. Index: hdrs/mcprt.h
  396. *** ../elm2.4/hdrs/mcprt.h    Sat Oct  3 18:35:08 1992
  397. --- hdrs/mcprt.h    Sun Aug 22 22:46:28 1993
  398. ***************
  399. *** 48,56 ****
  400. --- 48,62 ----
  401.   #include <stdio.h>
  402.   
  403.   #ifdef USENLS
  404. + #  ifdef I_STDARG
  405. + extern int         MCprintf(char *fmt, ...);
  406. + extern int         MCfprintf(FILE *fptr, char *fmt, ...);
  407. + extern int         MCsprintf(char *cptr, char *fmt, ...);
  408. + #  else
  409.   extern int         MCprintf();
  410.   extern int         MCfprintf();
  411.   extern int         MCsprintf();
  412. + #  endif
  413.   #endif
  414.   
  415.   #endif
  416.  
  417. Index: hdrs/mcprtlib.h
  418. *** ../elm2.4/hdrs/mcprtlib.h    Sat Oct  3 18:35:09 1992
  419. --- hdrs/mcprtlib.h    Sun Aug 22 22:48:18 1993
  420. ***************
  421. *** 41,47 ****
  422.   03/20/91   2 schulert    Ultrix cc has trouble with void*, so change them to int*
  423.   01/18/91   3 hamilton    #if not rescanned
  424.   01/12/91   1 schulert    conditionally use prototypes
  425. !             rework to use either varargs or stdargs
  426.   11/03/90   2 hamilton    Alphalpha->Alfalfa & OmegaMail->Poste
  427.   08/10/90   1 nazgul    Initial version
  428.   */
  429. --- 41,47 ----
  430.   03/20/91   2 schulert    Ultrix cc has trouble with void*, so change them to int*
  431.   01/18/91   3 hamilton    #if not rescanned
  432.   01/12/91   1 schulert    conditionally use prototypes
  433. !             rework to use either varargs or stdarg
  434.   11/03/90   2 hamilton    Alphalpha->Alfalfa & OmegaMail->Poste
  435.   08/10/90   1 nazgul    Initial version
  436.   */
  437. ***************
  438. *** 49,56 ****
  439. --- 49,61 ----
  440.   /* taken from Xm/lib/VaSimple.h
  441.      currently no one defines MISSING_STDARG_H */
  442.    
  443. + #ifdef    I_STDARG
  444. + # include <stdarg.h>
  445. + # define Va_start(a,b) va_start(a,b)
  446. + #else
  447.   # include <varargs.h>
  448.   # define Va_start(a,b) va_start(a)
  449. + #endif
  450.   
  451.   #define MCFree        0x0010            /* Reminder to MCPrintFree */
  452.   #define MCCatalog    0x0100            /* Probably came from catalog */
  453.  
  454. Index: hdrs/ndbz.h
  455. Prereq: 5.2
  456. *** ../elm2.4/hdrs/ndbz.h    Sat Oct 10 21:47:09 1992
  457. --- hdrs/ndbz.h    Mon Jul 19 22:59:54 1993
  458. ***************
  459. *** 1,8 ****
  460.   
  461. ! /* $Id: ndbz.h,v 5.2 1992/10/11 01:46:35 syd Exp $ */
  462.   
  463.   /*******************************************************************************
  464. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  465.    *
  466.    *             Copyright (c) 1988-1992 USENET Community Trust
  467.    *             Copyright (c) 1986,1987 Dave Taylor
  468. --- 1,8 ----
  469.   
  470. ! /* $Id: ndbz.h,v 5.3 1993/07/20 02:59:53 syd Exp $ */
  471.   
  472.   /*******************************************************************************
  473. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  474.    *
  475.    *             Copyright (c) 1988-1992 USENET Community Trust
  476.    *             Copyright (c) 1986,1987 Dave Taylor
  477. ***************
  478. *** 14,19 ****
  479. --- 14,23 ----
  480.    *
  481.    *******************************************************************************
  482.    * $Log: ndbz.h,v $
  483. +  * Revision 5.3  1993/07/20  02:59:53  syd
  484. +  * Support aliases both on 64 bit and 32 bit machines at the same time.
  485. +  * From: Dan Mosedale <mosedale@genome.stanford.edu>
  486. +  *
  487.    * Revision 5.2  1992/10/11  01:46:35  syd
  488.    * change dbm name to dbz to avoid conflicts with partial call
  489.    * ins from shared librarys, and from mixing code with yp code.
  490. ***************
  491. *** 57,63 ****
  492.    * to have a distinctive name for it.  Beware, this is just for readability,
  493.    * don't try to change this.
  494.    */
  495. ! #define    of_t    long
  496.   #define    SOF    (sizeof(of_t))
  497.   
  498.   /*
  499. --- 61,73 ----
  500.    * to have a distinctive name for it.  Beware, this is just for readability,
  501.    * don't try to change this.
  502.    */
  503. ! /*
  504. !  * Big kludge: this is set up as 32-bit rather than a long so that ndbz db's 
  505. !  * will work across NFS on 64 bit machines as well as 32 bit machines.
  506. !  */
  507. ! #define    of_t    int32
  508.   #define    SOF    (sizeof(of_t))
  509.   
  510.   /*
  511.  
  512. Index: hdrs/s_elm.h
  513. *** ../elm2.4/hdrs/s_elm.h    Mon May 31 15:35:18 1993
  514. --- hdrs/s_elm.h    Tue Aug  3 14:58:35 1993
  515. ***************
  516. *** 1,4 ****
  517. ! /* s_elm.h created from s_elm.us by gencat on Mon May 31 15:35:18 EDT 1993 */
  518.   
  519.   #define ElmSet    0x3
  520.   #define ElmYes    0x1
  521. --- 1,4 ----
  522. ! /* s_elm.h created from s_elm.us by gencat on Tue Aug  3 14:58:35 EDT 1993 */
  523.   
  524.   #define ElmSet    0x3
  525.   #define ElmYes    0x1
  526. ***************
  527. *** 499,505 ****
  528.   #define ElmTooManyWeedHeaders    0x233
  529.   #define ElmTooManyWeedPmalloc    0x234
  530.   #define ElmNoMemDefaultWeed    0x235
  531. ! #define ElmCantExpandEnvVar    0x236
  532.   #define ElmCouldntMakeTempFileName    0x237
  533.   #define ElmCouldntOpenForWriting    0x238
  534.   #define ElmSureYouWantToRemail    0x239
  535. --- 499,505 ----
  536.   #define ElmTooManyWeedHeaders    0x233
  537.   #define ElmTooManyWeedPmalloc    0x234
  538.   #define ElmNoMemDefaultWeed    0x235
  539. ! #define ElmCannotInitErrorExpanding    0x236
  540.   #define ElmCouldntMakeTempFileName    0x237
  541.   #define ElmCouldntOpenForWriting    0x238
  542.   #define ElmSureYouWantToRemail    0x239
  543.  
  544. Index: hdrs/save_opts.h
  545. Prereq: 5.8
  546. *** ../elm2.4/hdrs/save_opts.h    Sat May  8 16:02:01 1993
  547. --- hdrs/save_opts.h    Tue Aug 10 14:49:32 1993
  548. ***************
  549. *** 1,8 ****
  550.   
  551. ! /* @(#)$Id: save_opts.h,v 5.8 1993/05/08 18:56:16 syd Exp syd $ */
  552.   
  553.   /*******************************************************************************
  554. !  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  555.    *
  556.    *             Copyright (c) 1988-1992 USENET Community Trust
  557.    *             Copyright (c) 1986,1987 Dave Taylor
  558. --- 1,8 ----
  559.   
  560. ! /* @(#)$Id: save_opts.h,v 5.10 1993/08/10 18:49:32 syd Exp $ */
  561.   
  562.   /*******************************************************************************
  563. !  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
  564.    *
  565.    *             Copyright (c) 1988-1992 USENET Community Trust
  566.    *             Copyright (c) 1986,1987 Dave Taylor
  567. ***************
  568. *** 14,19 ****
  569. --- 14,30 ----
  570.    *
  571.    *******************************************************************************
  572.    * $Log: save_opts.h,v $
  573. +  * Revision 5.10  1993/08/10  18:49:32  syd
  574. +  * When an environment variable was given as the tmpdir definition the src
  575. +  * and dest overlapped in expand_env.  This made elm produce a garbage
  576. +  * expansion because expand_env cannot cope with overlapping src and
  577. +  * dest.  I added a new variable raw_temp_dir to keep src and dest not to
  578. +  * overlap.
  579. +  * From: Jukka Ukkonen <ukkonen@csc.fi>
  580. +  *
  581. +  * Revision 5.9  1993/06/12  05:28:06  syd
  582. +  * Missing checkin
  583. +  *
  584.    * Revision 5.8  1993/05/08  18:56:16  syd
  585.    * created a new elmrc variable named "readmsginc".  This specifies an
  586.    * increment by which the message count is updated.  If this variable is
  587. ***************
  588. *** 230,236 ****
  589.   #endif
  590.   {"timeout",        -1L,DT_NUM,(char *)&timeout},
  591.   {"titles",        -1L,DT_BOL,(char *)&title_messages},
  592. ! {"tmpdir",        -1L,DT_STR,temp_dir},
  593.   {"userlevel",        -1L,DT_NUM,(char *)&user_level},
  594.   {"username",        -1L,DT_SYN,"fullname"},
  595.   {"usetite",        -1L,DT_BOL|FL_AND,(char *)&use_tite},
  596. --- 241,247 ----
  597.   #endif
  598.   {"timeout",        -1L,DT_NUM,(char *)&timeout},
  599.   {"titles",        -1L,DT_BOL,(char *)&title_messages},
  600. ! {"tmpdir",        -1L,DT_STR,raw_temp_dir},
  601.   {"userlevel",        -1L,DT_NUM,(char *)&user_level},
  602.   {"username",        -1L,DT_SYN,"fullname"},
  603.   {"usetite",        -1L,DT_BOL|FL_AND,(char *)&use_tite},
  604.  
  605. Index: lib/Makefile.SH
  606. Prereq: 5.11
  607. *** ../elm2.4/lib/Makefile.SH    Sun Apr 11 21:51:43 1993
  608. --- lib/Makefile.SH    Tue Aug  3 15:28:46 1993
  609. ***************
  610. *** 36,42 ****
  611.   
  612.   echo "Extracting lib/Makefile (with variable substitutions)"
  613.   cat >Makefile <<!GROK!THIS!
  614. ! # $Id: Makefile.SH,v 5.11 1993/04/12 01:51:42 syd Exp $
  615.   #
  616.   #  Makefile for the ELM mail program.
  617.   #
  618. --- 36,42 ----
  619.   
  620.   echo "Extracting lib/Makefile (with variable substitutions)"
  621.   cat >Makefile <<!GROK!THIS!
  622. ! # $Id: Makefile.SH,v 5.15 1993/08/03 19:28:39 syd Exp $
  623.   #
  624.   #  Makefile for the ELM mail program.
  625.   #
  626. ***************
  627. *** 49,54 ****
  628. --- 49,88 ----
  629.   #            dsinc!elm
  630.   #
  631.   # $Log: Makefile.SH,v $
  632. + # Revision 5.15  1993/08/03  19:28:39  syd
  633. + # Elm tries to replace the system toupper() and tolower() on current
  634. + # BSD systems, which is unnecessary.  Even worse, the replacements
  635. + # collide during linking with routines in isctype.o.  This patch adds
  636. + # a Configure test to determine whether replacements are really needed
  637. + # (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  638. + # globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  639. + # there.  Inclusion of <ctype.h> was removed from *all* the individual
  640. + # files, and the toupper() and tolower() routines in lib/opt_utils.c
  641. + # were dropped.
  642. + # From: chip@chinacat.unicom.com (Chip Rosenthal)
  643. + #
  644. + # Revision 5.14  1993/08/03  19:17:33  syd
  645. + # Implement new timezone handling.  New file lib/get_tz.c with new timezone
  646. + # routines.  Added new TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx configuration
  647. + # definitions.  Obsoleted TZNAME, ALTCHECK, and TZ_MINUTESWEST configuration
  648. + # definitions.  Updated Configure.  Modified lib/getarpdate.c and
  649. + # lib/strftime.c to use new timezone routines.
  650. + #
  651. + # From: chip@chinacat.unicom.com (Chip Rosenthal)
  652. + #
  653. + # Revision 5.13  1993/08/02  18:14:35  syd
  654. + # add missing references for mcprt.c/mcprtlib.c to defs.h
  655. + # From: Syd
  656. + #
  657. + # Revision 5.12  1993/06/10  03:02:46  syd
  658. + # break_down_tolist() tried to blindly split address lists at "," which
  659. + # caused bogus results with addreses that had a comma inside a comment
  660. + # or quoted text, such as "user@domain (Last, First)".  This patch steps
  661. + # through the address in quanta of RFC-822 tokens when searching for a
  662. + # delimiting comma.  It also adds "rfc822_toklen()" to the library to
  663. + # get that length.
  664. + # From: chip@chinacat.unicom.com (Chip Rosenthal)
  665. + #
  666.   # Revision 5.11  1993/04/12  01:51:42  syd
  667.   # Added safe_malloc(), safe_realloc(), and safe_strdup().  They
  668.   # will be used in the new elmalias utility.
  669. ***************
  670. *** 162,167 ****
  671. --- 196,202 ----
  672.               getarpdate.c    \
  673.               getfullnam.c    \
  674.               getword.c    \
  675. +             get_tz.c    \
  676.               header_cmp.c    \
  677.               in_list.c    \
  678.               in_string.c    \
  679. ***************
  680. *** 182,187 ****
  681. --- 217,223 ----
  682.               qstrings.c    \
  683.               remfirstwd.c    \
  684.               reverse.c    \
  685. +             rfc822tlen.c    \
  686.               safemalloc.c    \
  687.               shiftlower.c    \
  688.               strfcpy.c    \
  689. ***************
  690. *** 207,212 ****
  691. --- 243,249 ----
  692.               expand.o    \
  693.               figadrssee.o    \
  694.               gcos_name.o    \
  695. +             get_tz.o    \
  696.               getaddrfrm.o    \
  697.               getarpdate.o    \
  698.               getfullnam.o    \
  699. ***************
  700. *** 231,236 ****
  701. --- 268,274 ----
  702.               realfrom.o    \
  703.               remfirstwd.o    \
  704.               reverse.o    \
  705. +             rfc822tlen.o    \
  706.               safemalloc.o    \
  707.               shiftlower.o    \
  708.               strfcpy.o    \
  709. ***************
  710. *** 280,285 ****
  711. --- 318,324 ----
  712.   #    Dependencies of C object files
  713.   add_site.o:    $(INCLDIR)/headers.h
  714.   addrmchusr.o:    $(INCLDIR)/headers.h
  715. + atonum.o:    $(INCLDIR)/defs.h
  716.   mk_aliases.o:    $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_newalias.h
  717.   aliasdb.o:    $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h
  718.   mk_lockname.o:    $(INCLDIR)/headers.h
  719. ***************
  720. *** 291,296 ****
  721. --- 330,336 ----
  722.   expand.o:    $(INCLDIR)/defs.h $(INCLDIR)/s_elmrc.h
  723.   figadrssee.o:    $(INCLDIR)/headers.h
  724.   gcos_name.o:    $(INCLDIR)/headers.h
  725. + get_tz.o:    $(INCLDIR)/defs.h
  726.   getaddrfrm.o:    $(INCLDIR)/headers.h
  727.   getarpdate.o:    $(INCLDIR)/headers.h
  728.   getfullnam.o:    $(INCLDIR)/headers.h
  729. ***************
  730. *** 302,309 ****
  731.   ldstate.o:    $(INCLDIR)/defs.h
  732.   len_next.o:    ../config.h
  733.   mail_gets.o:    ../config.h
  734. ! mcprt.o:    $(INCLDIR)/mcprt.h $(INCLDIR)/mcprtlib.h
  735. ! mcprtlib.o:    $(INCLDIR)/mcprtlib.h $(INCLDIR)/nl_types.h
  736.   move_left.o:    $(INCLDIR)/headers.h
  737.   msgcat.o:    $(INCLDIR)/msgcat.h $(INCLDIR)/nl_types.h
  738.   ndbz.o:        $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h
  739. --- 342,349 ----
  740.   ldstate.o:    $(INCLDIR)/defs.h
  741.   len_next.o:    ../config.h
  742.   mail_gets.o:    ../config.h
  743. ! mcprt.o:    $(INCLDIR)/mcprt.h $(INCLDIR)/mcprtlib.h $(INCLDIR)/defs.h
  744. ! mcprtlib.o:    $(INCLDIR)/mcprtlib.h $(INCLDIR)/nl_types.h $(INCLDIR)/defs.h
  745.   move_left.o:    $(INCLDIR)/headers.h
  746.   msgcat.o:    $(INCLDIR)/msgcat.h $(INCLDIR)/nl_types.h
  747.   ndbz.o:        $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h
  748.  
  749. Index: lib/aliasdb.c
  750. Prereq: 5.3
  751. *** ../elm2.4/lib/aliasdb.c    Tue Apr 20 21:40:16 1993
  752. --- lib/aliasdb.c    Sun Sep 19 19:41:00 1993
  753. ***************
  754. *** 1,5 ****
  755.   /*******************************************************************************
  756. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  757.    *
  758.    *            Copyright (c) 1988-1992 USENET Community Trust
  759.    *            Copyright (c) 1986,1987 Dave Taylor
  760. --- 1,8 ----
  761. + static char rcsid[] = "@(#)$Id: aliasdb.c,v 5.8 1993/09/19 23:40:48 syd Exp $";
  762.   /*******************************************************************************
  763. !  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  764.    *
  765.    *            Copyright (c) 1988-1992 USENET Community Trust
  766.    *            Copyright (c) 1986,1987 Dave Taylor
  767. ***************
  768. *** 11,16 ****
  769. --- 14,50 ----
  770.    *
  771.    *******************************************************************************
  772.    * $Log: aliasdb.c,v $
  773. +  * Revision 5.8  1993/09/19  23:40:48  syd
  774. +  * Defince SEEK_SET in one of our headers as a last resort
  775. +  * From: Syd
  776. +  *
  777. +  * Revision 5.7  1993/08/03  19:28:39  syd
  778. +  * Elm tries to replace the system toupper() and tolower() on current
  779. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  780. +  * collide during linking with routines in isctype.o.  This patch adds
  781. +  * a Configure test to determine whether replacements are really needed
  782. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  783. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  784. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  785. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  786. +  * were dropped.
  787. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  788. +  *
  789. +  * Revision 5.6  1993/07/20  02:59:53  syd
  790. +  * Support aliases both on 64 bit and 32 bit machines at the same time.
  791. +  * From: Dan Mosedale <mosedale@genome.stanford.edu>
  792. +  *
  793. +  * Revision 5.5  1993/06/10  03:12:10  syd
  794. +  * Add missing rcs id lines
  795. +  * From: Syd
  796. +  *
  797. +  * Revision 5.4  1993/06/10  02:58:26  syd
  798. +  * Correct problem in fetch_alias() with alias record fixup that caused
  799. +  * core dump on machines with pointers larger than int.  This problem
  800. +  * was reported on comp.mail.elm by Richard Eckman and Jim Brown.  Simplify
  801. +  * get_one_alias() by having it use fetch_alias().
  802. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  803. +  *
  804.    * Revision 5.3  1993/04/21  01:40:12  syd
  805.    * add seekset define
  806.    *
  807. ***************
  808. *** 35,53 ****
  809.   **/
  810.   
  811.   #include "headers.h"
  812. - #include <ctype.h>
  813.   #include "ndbz.h"
  814.   
  815. - #ifndef SEEK_SET
  816. - #define    SEEK_SET    0    /* Set file pointer to "offset" */
  817. - #define    SEEK_CUR    1    /* Set file pointer to current plus "offset" */
  818. - #define    SEEK_END    2    /* Set file pointer to EOF plus "offset" */
  819. - #endif
  820.   #ifdef BSD
  821.   #  include <sys/file.h>
  822. - #  undef tolower
  823. - #  undef toupper
  824.   #endif
  825.   
  826.   /* byte-ordering stuff */
  827. --- 69,78 ----
  828. ***************
  829. *** 74,82 ****
  830.       return(out.o);
  831.   }
  832.   
  833. ! read_one_alias(db, ar)
  834.   DBZ *db;
  835. ! struct alias_rec *ar;
  836.   {
  837.   /*
  838.    *    Read an alias (name, address, etc.) from the data file
  839. --- 99,107 ----
  840.       return(out.o);
  841.   }
  842.   
  843. ! read_one_alias(db, adr)
  844.   DBZ *db;
  845. ! struct alias_disk_rec *adr;
  846.   {
  847.   /*
  848.    *    Read an alias (name, address, etc.) from the data file
  849. ***************
  850. *** 87,104 ****
  851.       if (data_file == NULL)
  852.           return(0);    /* no alias file, but hash exists, error condition */
  853.   
  854. !     if (fread((char *) ar, sizeof(struct alias_rec), 1, data_file) <= 0)
  855. !         return(0);
  856.   
  857. -     ar->status = (int) MAPIN(ar->status);
  858. -     ar->alias = (char *) MAPIN(ar->alias);
  859. -     ar->last_name = (char *) MAPIN(ar->last_name);
  860. -     ar->name = (char *) MAPIN(ar->name);
  861. -     ar->comment = (char *) MAPIN(ar->comment);
  862. -     ar->address = (char *) MAPIN(ar->address);
  863. -     ar->type = (int) MAPIN(ar->type);
  864. -     ar->length = (long) MAPIN(ar->length);
  865.       return(1);
  866.   }
  867.   
  868. --- 112,130 ----
  869.       if (data_file == NULL)
  870.           return(0);    /* no alias file, but hash exists, error condition */
  871.   
  872. !     if (fread((char *) adr, sizeof(struct alias_disk_rec), 1, data_file)
  873. !         <= 0)
  874. !         return(0);
  875. !     adr->status = (int32) MAPIN(adr->status);
  876. !     adr->alias = (int32) MAPIN(adr->alias);
  877. !     adr->last_name = (int32) MAPIN(adr->last_name);
  878. !     adr->name = (int32) MAPIN(adr->name);
  879. !     adr->comment = (int32) MAPIN(adr->comment);
  880. !     adr->address = (int32) MAPIN(adr->address);
  881. !     adr->type = (int32) MAPIN(adr->type);
  882. !     adr->length = (int32) MAPIN(adr->length);
  883.   
  884.       return(1);
  885.   }
  886.   
  887. ***************
  888. *** 122,128 ****
  889.   char *alias;
  890.   {
  891.       datum key, val;
  892. !     struct alias_rec arec;
  893.       long pos;
  894.       register struct alias_rec *ar;
  895.       register char *buf, *s;
  896. --- 148,154 ----
  897.   char *alias;
  898.   {
  899.       datum key, val;
  900. !     struct alias_disk_rec adrec;
  901.       long pos;
  902.       register struct alias_rec *ar;
  903.       register char *buf, *s;
  904. ***************
  905. *** 159,194 ****
  906.           /*
  907.            * Move to the position of the selected alias record.
  908.            */
  909. !         pos = *((long *)(val.dptr)) - sizeof(struct alias_rec);
  910.           if (fseek(db->dbz_basef, pos, SEEK_SET) != 0)
  911.               return (struct alias_rec *)NULL;
  912.   
  913.       }
  914.   
  915.       /*
  916.        * We are now positioned at the alias record we want.  Pull it in.
  917.        */
  918. !     if (!read_one_alias(db, &arec))
  919.           return (struct alias_rec *)NULL;
  920.   
  921.       /*
  922.        * Allocate space to hold the alias record and data content.
  923.        */
  924.       ar = (struct alias_rec *)
  925. !         safe_malloc(sizeof(struct alias_rec) + arec.length);
  926. !     *ar = arec;
  927.       buf = (char *)ar + sizeof(struct alias_rec);
  928.   
  929.       /*
  930. !      * Read in the data content and fixup pointers in the alias record.
  931.        */
  932.       if (fread(buf, ar->length, 1, db->dbz_basef) != 1)
  933.           return (struct alias_rec *)NULL;
  934. -     ar->alias += (int) buf;
  935. -     ar->last_name += (int) buf;
  936. -     ar->name += (int) buf;
  937. -     ar->comment += (int) buf;
  938. -     ar->address += (int) buf;
  939.   
  940.       return ar;
  941.   }
  942. --- 185,239 ----
  943.           /*
  944.            * Move to the position of the selected alias record.
  945.            */
  946. !         pos = *((long *)(val.dptr)) - sizeof(struct alias_disk_rec);
  947.           if (fseek(db->dbz_basef, pos, SEEK_SET) != 0)
  948.               return (struct alias_rec *)NULL;
  949.   
  950.       }
  951.   
  952.       /*
  953. +      * Each alias in the data file is stored as a (struct alias_rec)
  954. +      * followed by text information for that alias record.  The
  955. +      * size of the following text information is specified by `length',
  956. +      * and the value of the other members of the structure are actually
  957. +      * offsets into that buffer space.  So, to load in an alias we
  958. +      * need to:  (1) read the alias record, (2) see how long the data
  959. +      * buffer is and pull it in, and (3) fixup the pointers in the
  960. +      * alias record so they point into the data buffer.
  961. +      */
  962. +     /*
  963.        * We are now positioned at the alias record we want.  Pull it in.
  964.        */
  965. !     if (!read_one_alias(db, &adrec))
  966.           return (struct alias_rec *)NULL;
  967.   
  968.       /*
  969.        * Allocate space to hold the alias record and data content.
  970.        */
  971.       ar = (struct alias_rec *)
  972. !         safe_malloc(sizeof(struct alias_rec) + (size_t)adrec.length);
  973.       buf = (char *)ar + sizeof(struct alias_rec);
  974.   
  975. +         /* 
  976. +      * Fixup pointers in the alias record.
  977. +      */
  978. +     ar->status = (int)adrec.status;
  979. +     ar->alias = (char *) ((size_t) adrec.alias + (size_t) buf);
  980. +     ar->last_name = (char *) ((size_t) adrec.last_name + (size_t) buf);
  981. +     ar->name = (char *) ((size_t) adrec.name + (size_t) buf);
  982. +     ar->comment = (char *) ((size_t) adrec.comment + (size_t) buf);
  983. +     ar->address = (char *) ((size_t) adrec.address + (size_t) buf);
  984. +     ar->type = (int)adrec.type;
  985. +     ar->length = (size_t)adrec.length;
  986.       /*
  987. !      * Read in the data content 
  988.        */
  989.       if (fread(buf, ar->length, 1, db->dbz_basef) != 1)
  990.           return (struct alias_rec *)NULL;
  991.   
  992.       return ar;
  993.   }
  994.  
  995. Index: lib/atonum.c
  996. Prereq: 5.1
  997. *** ../elm2.4/lib/atonum.c    Mon Jan 18 23:46:39 1993
  998. --- lib/atonum.c    Tue Aug  3 15:28:47 1993
  999. ***************
  1000. *** 1,8 ****
  1001.   
  1002. ! static char rcsid[] = "@(#)$Id: atonum.c,v 5.1 1993/01/19 04:46:21 syd Exp $";
  1003.   
  1004.   /*******************************************************************************
  1005. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  1006.    *
  1007.    *             Copyright (c) 1993 USENET Community Trust
  1008.    *******************************************************************************
  1009. --- 1,8 ----
  1010.   
  1011. ! static char rcsid[] = "@(#)$Id: atonum.c,v 5.2 1993/08/03 19:28:39 syd Exp $";
  1012.   
  1013.   /*******************************************************************************
  1014. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1015.    *
  1016.    *             Copyright (c) 1993 USENET Community Trust
  1017.    *******************************************************************************
  1018. ***************
  1019. *** 13,25 ****
  1020.    *
  1021.    *******************************************************************************
  1022.    * $Log: atonum.c,v $
  1023.    * Revision 5.1  1993/01/19  04:46:21  syd
  1024.    * Initial Checkin
  1025.    *
  1026.    *
  1027.    ******************************************************************************/
  1028.   
  1029. ! #include <ctype.h>
  1030.   
  1031.   /*
  1032.    * This is similar to atoi(), but it complains if the string
  1033. --- 13,37 ----
  1034.    *
  1035.    *******************************************************************************
  1036.    * $Log: atonum.c,v $
  1037. +  * Revision 5.2  1993/08/03  19:28:39  syd
  1038. +  * Elm tries to replace the system toupper() and tolower() on current
  1039. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1040. +  * collide during linking with routines in isctype.o.  This patch adds
  1041. +  * a Configure test to determine whether replacements are really needed
  1042. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1043. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1044. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1045. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1046. +  * were dropped.
  1047. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1048. +  *
  1049.    * Revision 5.1  1993/01/19  04:46:21  syd
  1050.    * Initial Checkin
  1051.    *
  1052.    *
  1053.    ******************************************************************************/
  1054.   
  1055. ! #include "defs.h"
  1056.   
  1057.   /*
  1058.    * This is similar to atoi(), but it complains if the string
  1059.  
  1060. Index: lib/can_access.c
  1061. Prereq: 5.6
  1062. *** ../elm2.4/lib/can_access.c    Thu May 13 23:52:11 1993
  1063. --- lib/can_access.c    Sun Aug 22 22:46:07 1993
  1064. ***************
  1065. *** 1,8 ****
  1066.   
  1067. ! static char rcsid[] = "@(#)$Id: can_access.c,v 5.6 1993/05/14 03:52:10 syd Exp $";
  1068.   
  1069.   /*******************************************************************************
  1070. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  1071.    *
  1072.    *            Copyright (c) 1988-1992 USENET Community Trust
  1073.    *            Copyright (c) 1986,1987 Dave Taylor
  1074. --- 1,8 ----
  1075.   
  1076. ! static char rcsid[] = "@(#)$Id: can_access.c,v 5.8 1993/08/23 02:46:07 syd Exp $";
  1077.   
  1078.   /*******************************************************************************
  1079. !  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  1080.    *
  1081.    *            Copyright (c) 1988-1992 USENET Community Trust
  1082.    *            Copyright (c) 1986,1987 Dave Taylor
  1083. ***************
  1084. *** 14,19 ****
  1085. --- 14,35 ----
  1086.    *
  1087.    *******************************************************************************
  1088.    * $Log: can_access.c,v $
  1089. +  * Revision 5.8  1993/08/23  02:46:07  syd
  1090. +  * Don't declare _exit() if <unistd.h> already did it.
  1091. +  * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
  1092. +  *
  1093. +  * Revision 5.7  1993/08/03  19:28:39  syd
  1094. +  * Elm tries to replace the system toupper() and tolower() on current
  1095. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1096. +  * collide during linking with routines in isctype.o.  This patch adds
  1097. +  * a Configure test to determine whether replacements are really needed
  1098. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1099. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1100. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1101. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1102. +  * were dropped.
  1103. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1104. +  *
  1105.    * Revision 5.6  1993/05/14  03:52:10  syd
  1106.    * When compiled on a POSIX host PL22 failed checking whether the file is
  1107.    * readable and a regular file or not. There was one `!' missing in the
  1108. ***************
  1109. *** 48,60 ****
  1110.   
  1111.   #include "headers.h"
  1112.   #include <sys/stat.h>
  1113. - #include <ctype.h>
  1114.   #include <errno.h>
  1115.   
  1116.   #ifdef BSD
  1117.   # include <sys/wait.h>
  1118.   #endif
  1119.   
  1120.   extern int errno;        /* system error number */
  1121.   
  1122.   int
  1123. --- 64,79 ----
  1124.   
  1125.   #include "headers.h"
  1126.   #include <sys/stat.h>
  1127.   #include <errno.h>
  1128.   
  1129.   #ifdef BSD
  1130.   # include <sys/wait.h>
  1131.   #endif
  1132.   
  1133. + #ifndef I_UNISTD
  1134. + void _exit();
  1135. + #endif
  1136.   extern int errno;        /* system error number */
  1137.   
  1138.   int
  1139. ***************
  1140. *** 66,72 ****
  1141.   
  1142.       int the_stat = 0, pid, w; 
  1143.       struct stat stat_buf;
  1144. -     void _exit();
  1145.   #if defined(BSD) && !defined(WEXITSTATUS)
  1146.       union wait status;
  1147.   #else
  1148. --- 85,90 ----
  1149.  
  1150. Index: lib/can_open.c
  1151. Prereq: 5.2
  1152. *** ../elm2.4/lib/can_open.c    Fri Dec 11 20:29:27 1992
  1153. --- lib/can_open.c    Sun Aug 22 22:46:08 1993
  1154. ***************
  1155. *** 1,8 ****
  1156.   
  1157. ! static char rcsid[] = "@(#)$Id: can_open.c,v 5.2 1992/12/12 01:29:26 syd Exp $";
  1158.   
  1159.   /*******************************************************************************
  1160. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1161.    *
  1162.    *            Copyright (c) 1988-1992 USENET Community Trust
  1163.    *            Copyright (c) 1986,1987 Dave Taylor
  1164. --- 1,8 ----
  1165.   
  1166. ! static char rcsid[] = "@(#)$Id: can_open.c,v 5.4 1993/08/23 02:46:07 syd Exp $";
  1167.   
  1168.   /*******************************************************************************
  1169. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  1170.    *
  1171.    *            Copyright (c) 1988-1992 USENET Community Trust
  1172.    *            Copyright (c) 1986,1987 Dave Taylor
  1173. ***************
  1174. *** 14,19 ****
  1175. --- 14,35 ----
  1176.    *
  1177.    *******************************************************************************
  1178.    * $Log: can_open.c,v $
  1179. +  * Revision 5.4  1993/08/23  02:46:07  syd
  1180. +  * Don't declare _exit() if <unistd.h> already did it.
  1181. +  * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
  1182. +  *
  1183. +  * Revision 5.3  1993/08/03  19:28:39  syd
  1184. +  * Elm tries to replace the system toupper() and tolower() on current
  1185. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1186. +  * collide during linking with routines in isctype.o.  This patch adds
  1187. +  * a Configure test to determine whether replacements are really needed
  1188. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1189. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1190. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1191. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1192. +  * were dropped.
  1193. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1194. +  *
  1195.    * Revision 5.2  1992/12/12  01:29:26  syd
  1196.    * Fix double inclusion of sys/types.h
  1197.    * From: Tom Moore <tmoore@wnas.DaytonOH.NCR.COM>
  1198. ***************
  1199. *** 30,42 ****
  1200.   
  1201.   #include "headers.h"
  1202.   #include <sys/stat.h>
  1203. - #include <ctype.h>
  1204.   #include <errno.h>
  1205.   
  1206.   #ifdef BSD
  1207.   # include <sys/wait.h>
  1208.   #endif
  1209.   
  1210.   extern int errno;        /* system error number */
  1211.   
  1212.   int
  1213. --- 46,61 ----
  1214.   
  1215.   #include "headers.h"
  1216.   #include <sys/stat.h>
  1217.   #include <errno.h>
  1218.   
  1219.   #ifdef BSD
  1220.   # include <sys/wait.h>
  1221.   #endif
  1222.   
  1223. + #ifndef I_UNISTD
  1224. + void _exit();
  1225. + #endif
  1226.   extern int errno;        /* system error number */
  1227.   
  1228.   int
  1229. ***************
  1230. *** 49,55 ****
  1231.   
  1232.       FILE *fd;
  1233.       int the_stat = 0, pid, w, preexisted = 0; 
  1234. -     void _exit();
  1235.   #if defined(BSD) && !defined(WEXITSTATUS)
  1236.       union wait status;
  1237.   #else
  1238. --- 68,73 ----
  1239.  
  1240. Index: lib/date_util.c
  1241. Prereq: 5.2
  1242. *** ../elm2.4/lib/date_util.c    Wed Jan 27 15:54:25 1993
  1243. --- lib/date_util.c    Tue Aug  3 15:28:48 1993
  1244. ***************
  1245. *** 1,8 ****
  1246.   
  1247. ! static char rcsid[] = "@(#)$Id: date_util.c,v 5.2 1993/01/27 20:54:24 syd Exp $";
  1248.   
  1249.   /*******************************************************************************
  1250. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1251.    *
  1252.    *             Copyright (c) 1993 USENET Community Trust
  1253.    *******************************************************************************
  1254. --- 1,8 ----
  1255.   
  1256. ! static char rcsid[] = "@(#)$Id: date_util.c,v 5.3 1993/08/03 19:28:39 syd Exp $";
  1257.   
  1258.   /*******************************************************************************
  1259. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  1260.    *
  1261.    *             Copyright (c) 1993 USENET Community Trust
  1262.    *******************************************************************************
  1263. ***************
  1264. *** 13,18 ****
  1265. --- 13,30 ----
  1266.    *
  1267.    *******************************************************************************
  1268.    * $Log: date_util.c,v $
  1269. +  * Revision 5.3  1993/08/03  19:28:39  syd
  1270. +  * Elm tries to replace the system toupper() and tolower() on current
  1271. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1272. +  * collide during linking with routines in isctype.o.  This patch adds
  1273. +  * a Configure test to determine whether replacements are really needed
  1274. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1275. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1276. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1277. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1278. +  * were dropped.
  1279. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1280. +  *
  1281.    * Revision 5.2  1993/01/27  20:54:24  syd
  1282.    * There is a small bug in this routine in Chip's PL21 patch.  The code
  1283.    * calls atonum to convert the 4 digit timezone field.  However this field
  1284. ***************
  1285. *** 27,33 ****
  1286.    ******************************************************************************/
  1287.   
  1288.   #include "headers.h"
  1289. - #include <ctype.h>
  1290.   
  1291.   /*
  1292.    * Date processing functions:
  1293. --- 39,44 ----
  1294.  
  1295. Index: lib/expand.c
  1296. Prereq: 5.3
  1297. *** ../elm2.4/lib/expand.c    Thu Dec 10 20:45:27 1992
  1298. --- lib/expand.c    Sun Sep 19 19:38:55 1993
  1299. ***************
  1300. *** 1,8 ****
  1301.   
  1302. ! static char rcsid[] = "@(#)$Id: expand.c,v 5.3 1992/12/11 01:45:04 syd Exp $";
  1303.   
  1304.   /*******************************************************************************
  1305. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  1306.    *
  1307.    *            Copyright (c) 1988-1992 USENET Community Trust
  1308.    *            Copyright (c) 1986,1987 Dave Taylor
  1309. --- 1,8 ----
  1310.   
  1311. ! static char rcsid[] = "@(#)$Id: expand.c,v 5.4 1993/09/19 23:38:55 syd Exp $";
  1312.   
  1313.   /*******************************************************************************
  1314. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  1315.    *
  1316.    *            Copyright (c) 1988-1992 USENET Community Trust
  1317.    *            Copyright (c) 1986,1987 Dave Taylor
  1318. ***************
  1319. *** 14,19 ****
  1320. --- 14,24 ----
  1321.    *
  1322.    *******************************************************************************
  1323.    * $Log: expand.c,v $
  1324. +  * Revision 5.4  1993/09/19  23:38:55  syd
  1325. +  * expand() didn't read the global rc file if the user elmrc didn't exist or
  1326. +  * didn't have an entry for maildir.
  1327. +  * From: Jan.Djarv@sa.erisoft.se (Jan Djarv)
  1328. +  *
  1329.    * Revision 5.3  1992/12/11  01:45:04  syd
  1330.    * remove sys/types.h include, it is now included by defs.h
  1331.    * and this routine includes defs.h or indirectly includes defs.h
  1332. ***************
  1333. *** 44,56 ****
  1334.   
  1335.   char *expand_define();
  1336.   
  1337.   int
  1338.   expand(filename)
  1339.   char *filename;
  1340.   {
  1341.       /** Expand the filename since the first character is a meta-
  1342.           character that should expand to the "maildir" variable
  1343. !         in the users ".elmrc" file...
  1344.   
  1345.           Note: this is a brute force way of getting the entry out 
  1346.           of the .elmrc file, and isn't recommended for the faint 
  1347. --- 49,93 ----
  1348.   
  1349.   char *expand_define();
  1350.   
  1351. + static char*
  1352. + expand_maildir(rcfile, filename, buffer)
  1353. + FILE *rcfile;
  1354. + char *filename;
  1355. + char *buffer;
  1356. + {
  1357. +     char *home = NULL, *bufptr;
  1358. +     int  foundit = 0;
  1359. +     bufptr = (char *) buffer;        /* same address */
  1360. +     
  1361. +     while (! foundit && mail_gets(buffer, SLEN, rcfile) != 0) {
  1362. +       if (strncmp(buffer, "maildir", 7) == 0 ||
  1363. +           strncmp(buffer, "folders", 7) == 0) {
  1364. +         while (*bufptr != '=' && *bufptr) 
  1365. +           bufptr++;
  1366. +         bufptr++;            /* skip the equals sign */
  1367. +         while (whitespace(*bufptr) && *bufptr)
  1368. +           bufptr++; 
  1369. +         home = bufptr;        /* remember this address */
  1370. +         while (! whitespace(*bufptr) && *bufptr != '\n')
  1371. +           bufptr++;
  1372. +         *bufptr = '\0';        /* remove trailing space */
  1373. +         foundit++;
  1374. +       }
  1375. +     }
  1376. +     return home;
  1377. + }
  1378.   int
  1379.   expand(filename)
  1380.   char *filename;
  1381.   {
  1382.       /** Expand the filename since the first character is a meta-
  1383.           character that should expand to the "maildir" variable
  1384. !         in the users ".elmrc" file or in the global rc file...
  1385.   
  1386.           Note: this is a brute force way of getting the entry out 
  1387.           of the .elmrc file, and isn't recommended for the faint 
  1388. ***************
  1389. *** 58,68 ****
  1390.       **/
  1391.   
  1392.       FILE *rcfile;
  1393. !     char  buffer[SLEN], *expanded_dir, *home, *bufptr;
  1394. !     int   foundit = 0;
  1395.   
  1396. -     bufptr = (char *) buffer;        /* same address */
  1397. -     
  1398.       if ((home = getenv("HOME")) == NULL) {
  1399.         printf(catgets(elm_msg_cat, ElmrcSet, ElmrcExpandHome,
  1400.            "Can't expand environment variable $HOME to find .elmrc file!\n"));
  1401. --- 95,102 ----
  1402.       **/
  1403.   
  1404.       FILE *rcfile;
  1405. !     char  buffer[SLEN], *home, *expanded_dir;
  1406.   
  1407.       if ((home = getenv("HOME")) == NULL) {
  1408.         printf(catgets(elm_msg_cat, ElmrcSet, ElmrcExpandHome,
  1409.            "Can't expand environment variable $HOME to find .elmrc file!\n"));
  1410. ***************
  1411. *** 71,105 ****
  1412.   
  1413.       sprintf(buffer, "%s/%s", home, elmrcfile);
  1414.   
  1415. !     if ((rcfile = fopen(buffer, "r")) == NULL) {
  1416. !       printf(catgets(elm_msg_cat, ElmrcSet, ElmrcOpenElmrc,
  1417. !         "Can't open your \".elmrc\" file (%s) for reading!\n"),
  1418. !          buffer);
  1419. !       return(NO);
  1420.       }
  1421.   
  1422. !     while (! foundit && mail_gets(buffer, SLEN, rcfile) != 0) {
  1423. !       if (strncmp(buffer, "maildir", 7) == 0 ||
  1424. !           strncmp(buffer, "folders", 7) == 0) {
  1425. !         while (*bufptr != '=' && *bufptr) 
  1426. !           bufptr++;
  1427. !         bufptr++;            /* skip the equals sign */
  1428. !         while (whitespace(*bufptr) && *bufptr)
  1429. !           bufptr++; 
  1430. !         home = bufptr;        /* remember this address */
  1431. !         while (! whitespace(*bufptr) && *bufptr != '\n')
  1432. !           bufptr++;
  1433. !         *bufptr = '\0';        /* remove trailing space */
  1434. !         foundit++;
  1435.         }
  1436.       }
  1437.   
  1438. !     fclose(rcfile);            /* be nice... */
  1439. !     if (! foundit) {
  1440. !       /* Use default */
  1441.         sprintf(buffer, "~/%s", default_folders);
  1442.         home = buffer;
  1443.       }
  1444. --- 105,125 ----
  1445.   
  1446.       sprintf(buffer, "%s/%s", home, elmrcfile);
  1447.   
  1448. !     home = NULL;
  1449. !     if ((rcfile = fopen(buffer, "r")) != NULL) {
  1450. !       home = expand_maildir(rcfile, filename, buffer);
  1451. !       fclose(rcfile);
  1452.       }
  1453.   
  1454. !     if (home == NULL) { /* elmrc didn't exist or maildir wasn't in it */
  1455. !       if ((rcfile = fopen(system_rc_file, "r")) != NULL) {
  1456. !         home = expand_maildir(rcfile, filename, buffer);
  1457. !         fclose(rcfile);
  1458.         }
  1459.       }
  1460.   
  1461. !     if (home == NULL) {
  1462. !       /* Didn't find it, use default */
  1463.         sprintf(buffer, "~/%s", default_folders);
  1464.         home = buffer;
  1465.       }
  1466.  
  1467. Index: lib/figadrssee.c
  1468. Prereq: 5.2
  1469. *** ../elm2.4/lib/figadrssee.c    Wed Feb  3 11:25:46 1993
  1470. --- lib/figadrssee.c    Sat Jun 12 01:33:39 1993
  1471. ***************
  1472. *** 1,8 ****
  1473.   
  1474. ! static char rcsid[] = "@(#)$Id: figadrssee.c,v 5.2 1993/02/03 16:25:45 syd Exp $";
  1475.   
  1476.   /*******************************************************************************
  1477. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1478.    *
  1479.    *            Copyright (c) 1988-1992 USENET Community Trust
  1480.    *            Copyright (c) 1986,1987 Dave Taylor
  1481. --- 1,8 ----
  1482.   
  1483. ! static char rcsid[] = "@(#)$Id: figadrssee.c,v 5.3 1993/06/12 05:33:32 syd Exp $";
  1484.   
  1485.   /*******************************************************************************
  1486. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  1487.    *
  1488.    *            Copyright (c) 1988-1992 USENET Community Trust
  1489.    *            Copyright (c) 1986,1987 Dave Taylor
  1490. ***************
  1491. *** 14,19 ****
  1492. --- 14,23 ----
  1493.    *
  1494.    *******************************************************************************
  1495.    * $Log: figadrssee.c,v $
  1496. +  * Revision 5.3  1993/06/12  05:33:32  syd
  1497. +  * Remove useless auto
  1498. +  * From: Syd
  1499. +  *
  1500.    * Revision 5.2  1993/02/03  16:25:45  syd
  1501.    * Adresses with double quoted strings that contains comma was parsed
  1502.    * wrongly by break_down_tolist() and figure_out_addressee().
  1503. ***************
  1504. *** 42,48 ****
  1505.       **/
  1506.   
  1507.       char *address, *bufptr, mybuf[SLEN];
  1508. -     register int index2 = 0;
  1509.       
  1510.       if (equal(mail_to, username)) return;    /* can't be better! */
  1511.   
  1512. --- 46,51 ----
  1513.  
  1514. Index: lib/gcos_name.c
  1515. Prereq: 5.2
  1516. *** ../elm2.4/lib/gcos_name.c    Tue Jan 19 22:02:33 1993
  1517. --- lib/gcos_name.c    Tue Aug  3 15:28:49 1993
  1518. ***************
  1519. *** 1,7 ****
  1520. ! static char rcsid[] = "@(#)$Id: gcos_name.c,v 5.2 1993/01/20 03:02:19 syd Exp $";
  1521.   
  1522.   /*******************************************************************************
  1523. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1524.    *
  1525.    *            Copyright (c) 1988-1992 USENET Community Trust
  1526.    *            Copyright (c) 1986,1987 Dave Taylor
  1527. --- 1,7 ----
  1528. ! static char rcsid[] = "@(#)$Id: gcos_name.c,v 5.3 1993/08/03 19:28:39 syd Exp $";
  1529.   
  1530.   /*******************************************************************************
  1531. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  1532.    *
  1533.    *            Copyright (c) 1988-1992 USENET Community Trust
  1534.    *            Copyright (c) 1986,1987 Dave Taylor
  1535. ***************
  1536. *** 13,18 ****
  1537. --- 13,30 ----
  1538.    *
  1539.    *******************************************************************************
  1540.    * $Log: gcos_name.c,v $
  1541. +  * Revision 5.3  1993/08/03  19:28:39  syd
  1542. +  * Elm tries to replace the system toupper() and tolower() on current
  1543. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1544. +  * collide during linking with routines in isctype.o.  This patch adds
  1545. +  * a Configure test to determine whether replacements are really needed
  1546. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1547. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1548. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1549. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1550. +  * were dropped.
  1551. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1552. +  *
  1553.    * Revision 5.2  1993/01/20  03:02:19  syd
  1554.    * Move string declarations to defs.h
  1555.    * From: Syd
  1556. ***************
  1557. *** 28,39 ****
  1558.   **/
  1559.   
  1560.   #include "headers.h"
  1561. - #include <ctype.h>
  1562. - #ifdef BSD 
  1563. - #undef tolower
  1564. - #undef toupper
  1565. - #endif
  1566.   
  1567.   char *
  1568.   gcos_name(gcos_field, logname)
  1569. --- 40,45 ----
  1570.  
  1571. Index: lib/get_tz.c
  1572. *** /dev/null    Sun Sep 19 14:13:21 1993
  1573. --- lib/get_tz.c    Tue Aug 10 14:57:50 1993
  1574. ***************
  1575. *** 0 ****
  1576. --- 1,298 ----
  1577. + static char rcsid[] = "@(#)$Id: get_tz.c,v 5.1 1993/08/10 18:56:53 syd Exp $";
  1578. + /*******************************************************************************
  1579. +  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  1580. +  *
  1581. +  *             Copyright (c) 1992, 1993 USENET Community Trust
  1582. +  *******************************************************************************
  1583. +  * Bug reports, patches, comments, suggestions should be sent to:
  1584. +  *
  1585. +  *    Syd Weinstein, Elm Coordinator
  1586. +  *    elm@DSI.COM            dsinc!elm
  1587. +  *
  1588. +  *******************************************************************************
  1589. +  * $Log: get_tz.c,v $
  1590. +  * Revision 5.1  1993/08/10  18:56:53  syd
  1591. +  * Initial Checkin
  1592. +  *
  1593. +  *
  1594. +  ******************************************************************************/
  1595. + /*
  1596. +  * get_tz - Site-specific timezone handling.
  1597. +  *
  1598. +  * get_tz_mins(tm) - Return timezone adjustment in minutes west of GMT.
  1599. +  * get_tz_name(tm) - Return timezone name.
  1600. +  *
  1601. +  * These procedures return timezone infomation for the time specified by "tm".
  1602. +  * If "tm" is NULL, then the local, current timezone info are returned.
  1603. +  *
  1604. +  * On some systems, regardless of the "tm" value, the local timezone
  1605. +  * values are returned.
  1606. +  *
  1607. +  * On some systems, when passing a non-NULL "tm" value, a call to "tzset()"
  1608. +  * must be performed prior to invoking these routines to obtain proper
  1609. +  * timezone information.  Note that some systems will implicitly call
  1610. +  * "tzset()" through other routines, such as "localtime()".  On such
  1611. +  * systems an explicit "tzset()" is not required if the "tm" value was
  1612. +  * obtained through a routine that does the implicit setup.
  1613. +  *
  1614. +  * The task of discovering timezone info is a horrid mess because so many
  1615. +  * systems have different notions about how to do it.  The goal of these
  1616. +  * routines is to encapsulate the system dependancies here.  Two definitions,
  1617. +  * TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx must be enabled as appropriate
  1618. +  * for this system.  Exactly _one_ definition from each group must be
  1619. +  * specified.  The available choices are:
  1620. +  *
  1621. +  * TZMINS_USE_xxxxxx specifies how to get timezone offset.
  1622. +  *
  1623. +  *    TZMINS_USE_TM_TZADJ    use (struct tm*)->tm_tzadj
  1624. +  *    TZMINS_USE_TM_GMTOFF   use (struct tm*)->tm_gmtoff
  1625. +  *    TZMINS_USE_TZAZ_GLOBAL use "timezone, altzone" externals
  1626. +  *    TZMINS_USE_TZ_GLOBAL   use "timezone" external
  1627. +  *    TZMINS_USE_FTIME       use ftime() function
  1628. +  *    TZMINS_USE_TIMEOFDAY   use gettimeofday() function
  1629. +  *
  1630. +  * TZNAME_USE_xxxxxx specifies how to get timezone name.
  1631. +  *
  1632. +  *    TZNAME_USE_TM_NAME     use (struct tm *)->tm_name
  1633. +  *    TZNAME_USE_TM_ZONE     use (struct tm *)->tm_zone
  1634. +  *    TZNAME_USE_TZNAME      use "tzname[]" external
  1635. +  *    TZNAME_USE_TIMEZONE    use timezone() function
  1636. +  *
  1637. +  * The TZMINS_HANDLING and TZNAME_HANDLING definitions are just used
  1638. +  * to verify the configurations were setup correctly.  They force
  1639. +  * compiler warnings and/or errors in the event of a configuration problem.
  1640. +  */
  1641. + #include "defs.h"
  1642. + #ifdef I_TIME
  1643. + #  include <time.h>
  1644. + #endif
  1645. + #ifdef I_SYSTIME
  1646. + #  include <sys/time.h>
  1647. + #endif
  1648. + #ifdef TZMINS_USE_FTIME
  1649. + #  include <sys/timeb.h>
  1650. + #endif
  1651. + #ifndef    _POSIX_SOURCE
  1652. + extern struct tm *localtime();
  1653. + extern time_t      time();
  1654. + #endif
  1655. + /****************************************************************************/
  1656. + int get_tz_mins(tm)
  1657. + struct tm *tm;
  1658. + {
  1659. +     if (tm == 0) {
  1660. +         time_t t;
  1661. +         (void) time(&t);
  1662. +         tm = localtime(&t);
  1663. +     }
  1664. + #ifdef TZMINS_USE_TM_TZADJ
  1665. + #define TZMINS_HANDLING 1
  1666. +     /*
  1667. +      * This system maintains the timezone offset in the (struct tm)
  1668. +      * as a number of _seconds_ west of GMT.
  1669. +      */
  1670. +     return (int)(tm->tm_tzadj / 60);
  1671. + #endif
  1672. + #ifdef TZMINS_USE_TM_GMTOFF
  1673. + #define TZMINS_HANDLING 2
  1674. +     /*
  1675. +      * This system maintains the timezone offset in the (struct tm)
  1676. +      * as a number of _seconds_ _east_ of GMT.  Since this is an
  1677. +      * easterly pointing offset, we need to flip the sign to go the
  1678. +      * other direction.
  1679. +      */
  1680. +     return (int)(-tm->tm_gmtoff / 60);
  1681. + #endif
  1682. + #ifdef TZMINS_USE_TZAZ_GLOBAL
  1683. + #define TZMINS_HANDLING 3
  1684. +     /*
  1685. +      * This system maintains timezone offsets in global variables
  1686. +      * as a number of _seconds_ west of GMT.  There are two globals,
  1687. +      * one for when DST is in effect and one for when it is not,
  1688. +      * and we need to select the correct one.
  1689. +      */
  1690. +     {
  1691. +         extern long altzone, timezone;
  1692. +         return (int)((tm->tm_isdst ? altzone : timezone) / 60);
  1693. +     }
  1694. + #endif
  1695. + #ifdef TZMINS_USE_TZ_GLOBAL
  1696. + #define TZMINS_HANDLING 4
  1697. +     /*
  1698. +      * This system maintains the timezone offset in a global variable as
  1699. +      * a number of _seconds_ west of GMT.  We need to correct this value
  1700. +      * if DST is in effect.  Note that the global "daylight" indicates
  1701. +      * that DST applies to this site and NOT necessarily that the DST
  1702. +      * correction needs to be applied right now.  Be careful -- some
  1703. +      * systems have a "timezone()" procedure and this method will return
  1704. +      * the address of that procedure rather than a timezone offset!
  1705. +      */
  1706. +     {
  1707. +         extern long timezone;
  1708. +         extern int daylight;
  1709. +         return (int)(timezone/60) -
  1710. +             ((daylight && tm->tm_isdst) ? 60 : 0);
  1711. +     }
  1712. + #endif
  1713. + #ifdef TZMINS_USE_TIMEOFDAY
  1714. + #define TZMINS_HANDLING 5
  1715. +     /*
  1716. +      * This system uses gettimeofday() to obtain the timezone
  1717. +      * information as minutes west of GMT.  The returned value will
  1718. +      * not be corrected for DST (unless you are unlucky enough to
  1719. +      * own a Unix written by some unmentionable vendor), so we will
  1720. +      * need to account for that.  Be careful -- some systems that
  1721. +      * have this procedure depreciate its use for timezone information
  1722. +      * and recommend it only for the high-resolution time information.
  1723. +      * On these systems the timezone info may be some kernel default
  1724. +      * or even garbage.
  1725. +      */
  1726. +     {
  1727. +         struct timeval tv;
  1728. +         struct timezone tz;
  1729. +         (void) gettimeofday(&tv, &tz);
  1730. + #ifdef AIX
  1731. +         return tz.tz_minuteswest;
  1732. + #else
  1733. +         return tz.tz_minuteswest -
  1734. +             (tm->tm_isdst && tz.tz_dsttime != DST_NONE ? 60 : 0);
  1735. + #endif
  1736. +     }
  1737. + #endif
  1738. + #ifdef TZMINS_USE_FTIME
  1739. + #define TZMINS_HANDLING 6
  1740. +     /*
  1741. +      * This system uses ftime() to obtain the timezone information
  1742. +      * as minutes west of GMT.  The returned value will not be
  1743. +      * corrected for DST, so we will need to account for that.  Be
  1744. +      * careful -- some systems that have this procedure depreciate
  1745. +      * its use for timezone information and recommend it only for
  1746. +      * the high-resolution time information.  On these systems the
  1747. +      * timezone info may be some kernel default or even garbage.
  1748. +      */
  1749. +     {
  1750. +         struct timeb tb;
  1751. +         (void) ftime(&tb);
  1752. +         return tb.timezone - (tm->tm_isdst ? 60 : 0);
  1753. +     }
  1754. + #endif
  1755. + #ifndef TZMINS_HANDLING
  1756. +     /* Force a compile error if the timezone config is wrong. */
  1757. +     no_tzmins_handling_defined(TZMINS_HANDLING);
  1758. + #endif
  1759. + }
  1760. + /****************************************************************************/
  1761. + char *get_tz_name(tm)
  1762. + struct tm *tm;
  1763. + {
  1764. +     if (tm == 0) {
  1765. +         time_t t;
  1766. +         (void) time(&t);
  1767. +         tm = localtime(&t);
  1768. +     }
  1769. + #ifdef TZNAME_USE_TM_NAME
  1770. + #define TZNAME_HANDLING 1
  1771. +     /*
  1772. +      * This system maintains the timezone name in the (struct tm).
  1773. +      */
  1774. +     return tm->tm_name;
  1775. + #endif
  1776. + #ifdef TZNAME_USE_TM_ZONE
  1777. + #define TZNAME_HANDLING 2
  1778. +     /*
  1779. +      * This system maintains the timezone name in the (struct tm).
  1780. +      */
  1781. +     return tm->tm_zone;
  1782. + #endif
  1783. + #ifdef TZNAME_USE_TZNAME
  1784. + #define TZNAME_HANDLING 3
  1785. +     /*
  1786. +      * This system maintains a global array that contains two timezone
  1787. +      * names, one for when DST is in effect and one for when it is not.
  1788. +      * We simply need to pick the right one.
  1789. +      */
  1790. +     {
  1791. +         extern char *tzname[];
  1792. +         return tzname[tm->tm_isdst];
  1793. +     }
  1794. + #endif
  1795. + #ifdef TZNAME_USE_TIMEZONE
  1796. + #define TZNAME_HANDLING 4
  1797. +     /*
  1798. +      * This system provides a timezone() procedure to get a timezone
  1799. +      * name.  Be careful -- some systems have this procedure but
  1800. +      * depreciate its use, and in some cases it is outright broke.
  1801. +      */
  1802. +     {
  1803. +         extern char *timezone();
  1804. +         return timezone(get_tz_mins(tm), tm->tm_isdst);
  1805. +     }
  1806. + #endif
  1807. + #ifndef TZNAME_HANDLING
  1808. +     /* Force a compile error if the timezone config is wrong. */
  1809. +     no_tzname_handling_defined(TZNAME_HANDLING);
  1810. + #endif
  1811. + }
  1812. + /****************************************************************************/
  1813. + #ifdef _TEST
  1814. + /*
  1815. +  * It would be best to futz around with the TZ setting when running this
  1816. +  * test.  In all cases, the "null" and the "localtime()" results should
  1817. +  * be identical, and the "gmtime()" results should indicate "GMT 0"
  1818. +  * regardless of TZ setting.  Here are a few possible TZ settings you
  1819. +  * can try, and the result you should expect.
  1820. +  *
  1821. +  *    TZ=GMT            always GMT 0
  1822. +  *    TZ=CST6CDT        CST 360 or CDT 300, depending upon time of year
  1823. +  *    TZ=EST5EDT        EST 300 or EDT 240, depending upon time of year
  1824. +  *    TZ=EST5EDT;0,364    always EDT 240
  1825. +  *    TZ=EST5EDT;0,0        always EST 300
  1826. +  *
  1827. +  * Oh...this all assumes your system supports TZ. :-)
  1828. +  */
  1829. + main()
  1830. + {
  1831. +     time_t t;
  1832. +     struct tm *tm;
  1833. +     static char f[] = "using %s tm struct - name=\"%s\" mins_west=\"%d\"\n";
  1834. +     (void) time(&t);
  1835. +     tm = (struct tm *)0;
  1836. +     printf(f, "null", get_tz_name(tm), get_tz_mins(tm));
  1837. +     tm = localtime(&t);
  1838. +     printf(f, "localtime()", get_tz_name(tm), get_tz_mins(tm));
  1839. +     tm = gmtime(&t);
  1840. +     printf(f, "gmtime()", get_tz_name(tm), get_tz_mins(tm));
  1841. +     exit(0);
  1842. + }
  1843. + #endif /*_TEST*/
  1844.  
  1845. Index: lib/getaddrfrm.c
  1846. Prereq: 5.3
  1847. *** ../elm2.4/lib/getaddrfrm.c    Sun May 16 16:55:52 1993
  1848. --- lib/getaddrfrm.c    Tue Aug  3 15:28:49 1993
  1849. ***************
  1850. *** 1,8 ****
  1851.   
  1852. ! static char rcsid[] = "@(#)$Id: getaddrfrm.c,v 5.3 1993/05/16 20:55:52 syd Exp $";
  1853.   
  1854.   /*******************************************************************************
  1855. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  1856.    *
  1857.    *            Copyright (c) 1988-1992 USENET Community Trust
  1858.    *            Copyright (c) 1986,1987 Dave Taylor
  1859. --- 1,8 ----
  1860.   
  1861. ! static char rcsid[] = "@(#)$Id: getaddrfrm.c,v 5.4 1993/08/03 19:28:39 syd Exp $";
  1862.   
  1863.   /*******************************************************************************
  1864. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  1865.    *
  1866.    *            Copyright (c) 1988-1992 USENET Community Trust
  1867.    *            Copyright (c) 1986,1987 Dave Taylor
  1868. ***************
  1869. *** 14,19 ****
  1870. --- 14,31 ----
  1871.    *
  1872.    *******************************************************************************
  1873.    * $Log: getaddrfrm.c,v $
  1874. +  * Revision 5.4  1993/08/03  19:28:39  syd
  1875. +  * Elm tries to replace the system toupper() and tolower() on current
  1876. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1877. +  * collide during linking with routines in isctype.o.  This patch adds
  1878. +  * a Configure test to determine whether replacements are really needed
  1879. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1880. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1881. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1882. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1883. +  * were dropped.
  1884. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1885. +  *
  1886.    * Revision 5.3  1993/05/16  20:55:52  syd
  1887.    * Fix bug where text following "<" within double-quote delimited comment
  1888.    * is taken as an address.
  1889. ***************
  1890. *** 34,40 ****
  1891.   **/
  1892.   
  1893.   #include "headers.h"
  1894. - #include <ctype.h>
  1895.   
  1896.   #ifdef USE_EMBEDDED_ADDRESSES
  1897.   
  1898. --- 46,51 ----
  1899.  
  1900. Index: lib/getarpdate.c
  1901. Prereq: 5.8
  1902. *** ../elm2.4/lib/getarpdate.c    Sat May  8 15:22:46 1993
  1903. --- lib/getarpdate.c    Tue Aug  3 15:20:59 1993
  1904. ***************
  1905. *** 1,7 ****
  1906. ! static char rcsid[] = "@(#)$Id: getarpdate.c,v 5.8 1993/05/08 19:22:46 syd Exp $";
  1907.   
  1908.   /*******************************************************************************
  1909. !  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  1910.    *
  1911.    *            Copyright (c) 1988-1992 USENET Community Trust
  1912.    *            Copyright (c) 1986,1987 Dave Taylor
  1913. --- 1,7 ----
  1914. ! static char rcsid[] = "@(#)$Id: getarpdate.c,v 5.9 1993/08/03 19:17:33 syd Exp $";
  1915.   
  1916.   /*******************************************************************************
  1917. !  *  The Elm Mail System  -  $Revision: 5.9 $   $State: Exp $
  1918.    *
  1919.    *            Copyright (c) 1988-1992 USENET Community Trust
  1920.    *            Copyright (c) 1986,1987 Dave Taylor
  1921. ***************
  1922. *** 13,18 ****
  1923. --- 13,27 ----
  1924.    *
  1925.    *******************************************************************************
  1926.    * $Log: getarpdate.c,v $
  1927. +  * Revision 5.9  1993/08/03  19:17:33  syd
  1928. +  * Implement new timezone handling.  New file lib/get_tz.c with new timezone
  1929. +  * routines.  Added new TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx configuration
  1930. +  * definitions.  Obsoleted TZNAME, ALTCHECK, and TZ_MINUTESWEST configuration
  1931. +  * definitions.  Updated Configure.  Modified lib/getarpdate.c and
  1932. +  * lib/strftime.c to use new timezone routines.
  1933. +  *
  1934. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1935. +  *
  1936.    * Revision 5.8  1993/05/08  19:22:46  syd
  1937.    * On the DEC Alpha, OSF/1 the following change made things happy.
  1938.    * From: dave@opus.csd.uwm.edu (Dave Rasmussen)
  1939. ***************
  1940. *** 49,58 ****
  1941.    *
  1942.    ******************************************************************************/
  1943.   
  1944. - /** 
  1945. - **/
  1946.   #include "headers.h"
  1947.   
  1948.   #ifdef I_TIME
  1949. --- 58,63 ----
  1950. ***************
  1951. *** 61,75 ****
  1952.   #ifdef I_SYSTIME
  1953.   #  include <sys/time.h>
  1954.   #endif
  1955. - #ifdef BSD
  1956. - #  include <sys/timeb.h>
  1957. - #endif
  1958. - #include <ctype.h>
  1959.   
  1960.   #ifndef    _POSIX_SOURCE
  1961.   extern struct tm *localtime();
  1962. - extern struct tm *gmtime();
  1963.   extern time_t      time();
  1964.   #endif
  1965.   
  1966. --- 66,74 ----
  1967. ***************
  1968. *** 79,93 ****
  1969.   static char *arpa_monname[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
  1970.             "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""};
  1971.   
  1972. ! #ifdef TZNAME
  1973. !   extern char *tzname[];
  1974. ! #else
  1975. !   char *timezone();
  1976. ! #endif
  1977. ! #ifdef _AIX370
  1978. ! #undef ALTCHECK
  1979. ! #endif /* _AIX370 */
  1980.   
  1981.   char *
  1982.   get_arpa_date()
  1983. --- 78,85 ----
  1984.   static char *arpa_monname[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
  1985.             "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""};
  1986.   
  1987. ! extern int get_tz_mins();
  1988. ! extern char *get_tz_name();
  1989.   
  1990.   char *
  1991.   get_arpa_date()
  1992. ***************
  1993. *** 100,190 ****
  1994.       **/
  1995.   
  1996.       static char buffer[SLEN];    /* static character buffer       */
  1997. !     struct tm *the_time;        /* Time structure, see CTIME(3C) */
  1998. !     time_t       junk;        /* time in seconds....         */
  1999.       long       tzmin;        /* number of minutes off gmt      */
  2000.       char      *tzsign;        /* + or - gmt              */
  2001. ! #if !defined(TZNAME) || defined(_AIX)
  2002. ! # ifndef TZ_MINUTESWEST
  2003. !     struct timeb    loc_time;
  2004. !     junk = time((time_t *) 0);
  2005. !     ftime(&loc_time);
  2006. ! # else /* TZ_MINUTESWEST */
  2007. !     struct  timeval  time_val;        
  2008. !     struct  timezone time_zone;
  2009. !     gettimeofday(&time_val, &time_zone);
  2010. !     junk = time_val.tv_sec;
  2011. ! # endif /* TZ_MINUTESWEST */
  2012. ! #else /* TZNAME */
  2013. ! # ifndef __osf__
  2014. !     extern    time_t    timezone;
  2015. ! # endif /* __osf__ */
  2016. ! # ifdef ALTCHECK
  2017. !     extern    time_t    altzone;
  2018. ! # endif
  2019. !     junk = time((time_t *) 0);    /* this must be here for it to work! */
  2020. ! #endif /* TZNAME */
  2021. !     the_time = localtime(&junk);
  2022. !     if (the_time->tm_year < 100)
  2023. !         the_time->tm_year += 1900;
  2024. ! #if !defined(TZNAME) || defined(_AIX)
  2025. ! # ifdef TZ_MINUTESWEST
  2026. ! #  ifndef AIX
  2027. !     if (the_time->tm_isdst && time_zone.tz_dsttime != DST_NONE)
  2028. !         tzmin = - (time_zone.tz_minuteswest - 60);
  2029. !     else
  2030. ! #  endif /* AIX */
  2031. !         tzmin = - time_zone.tz_minuteswest;
  2032. ! # else /* TZ_MINUTESWEST */
  2033. !     tzmin = the_time->tm_gmtoff / 60;
  2034. ! # endif /* TZ_MINUTESWEST */
  2035. ! #else /* TZNAME */
  2036. ! # ifdef ALTCHECK
  2037. !     if (the_time->tm_isdst)
  2038. !         tzmin = - (altzone / 60);
  2039. !     else
  2040. !         tzmin = - (timezone / 60);
  2041. ! # else /* ALTCHECK */
  2042. !     tzmin = - (timezone / 60);
  2043. ! # endif /* ALTCHECK */
  2044. ! #endif /* TZNAME */
  2045.   
  2046. !     if (tzmin >= 0)
  2047.           tzsign = "+";
  2048. !     else {
  2049.           tzsign = "-";
  2050.           tzmin = -tzmin;
  2051.       }
  2052.       sprintf(buffer, "%s, %d %s %d %02d:%02d:%02d %s%02d%02d (%s)",
  2053. !       arpa_dayname[the_time->tm_wday],
  2054. !       the_time->tm_mday,
  2055. !       arpa_monname[the_time->tm_mon], the_time->tm_year,
  2056. !       the_time->tm_hour, the_time->tm_min, the_time->tm_sec,
  2057. !       tzsign, tzmin / 60, tzmin % 60,
  2058. ! #if !defined(TZNAME) || defined(_AIX)
  2059. ! #ifdef TZ_MINUTESWEST
  2060. ! # ifdef GOULD_NP1
  2061. !       the_time->tm_zone);
  2062. ! # else
  2063. ! #  ifndef _AIX
  2064. !       timezone(time_zone.tz_minuteswest, the_time->tm_isdst));
  2065. ! #  else /* AIX has tzname */
  2066. !       tzname[the_time->tm_isdst]);      
  2067. ! #  endif      
  2068. ! # endif
  2069. ! #else
  2070. !       timezone(loc_time.timezone, the_time->tm_isdst));
  2071. ! #endif
  2072. ! #else
  2073. !       tzname[the_time->tm_isdst]);
  2074. ! #endif
  2075.       
  2076. !     return( (char *) buffer);
  2077.   }
  2078. --- 92,118 ----
  2079.       **/
  2080.   
  2081.       static char buffer[SLEN];    /* static character buffer       */
  2082. !     time_t       curr_time;        /* time in seconds....         */
  2083. !     struct tm *curr_tm;        /* Time structure, see CTIME(3C) */
  2084.       long       tzmin;        /* number of minutes off gmt      */
  2085.       char      *tzsign;        /* + or - gmt              */
  2086. !     int      year;            /* current year - with century     */
  2087.   
  2088. !     (void) time(&curr_time);
  2089. !     curr_tm = localtime(&curr_time);
  2090. !     if ((year = curr_tm->tm_year) < 100)
  2091. !         year += 1900;
  2092. !     if ((tzmin = -get_tz_mins(curr_tm)) >= 0) {
  2093.           tzsign = "+";
  2094. !     } else {
  2095.           tzsign = "-";
  2096.           tzmin = -tzmin;
  2097.       }
  2098.       sprintf(buffer, "%s, %d %s %d %02d:%02d:%02d %s%02d%02d (%s)",
  2099. !       arpa_dayname[curr_tm->tm_wday],
  2100. !       curr_tm->tm_mday, arpa_monname[curr_tm->tm_mon], year,
  2101. !       curr_tm->tm_hour, curr_tm->tm_min, curr_tm->tm_sec,
  2102. !       tzsign, tzmin / 60, tzmin % 60, get_tz_name(curr_tm));
  2103.       
  2104. !     return buffer;
  2105.   }
  2106.  
  2107. Index: lib/getword.c
  2108. Prereq: 5.1
  2109. *** ../elm2.4/lib/getword.c    Mon Jan 18 23:46:52 1993
  2110. --- lib/getword.c    Tue Aug  3 15:28:50 1993
  2111. ***************
  2112. *** 1,8 ****
  2113.   
  2114. ! static char rcsid[] = "@(#)$Id: getword.c,v 5.1 1993/01/19 04:46:21 syd Exp $";
  2115.   
  2116.   /*******************************************************************************
  2117. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  2118.    *
  2119.    *             Copyright (c) 1993 USENET Community Trust
  2120.    *******************************************************************************
  2121. --- 1,8 ----
  2122.   
  2123. ! static char rcsid[] = "@(#)$Id: getword.c,v 5.2 1993/08/03 19:28:39 syd Exp $";
  2124.   
  2125.   /*******************************************************************************
  2126. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  2127.    *
  2128.    *             Copyright (c) 1993 USENET Community Trust
  2129.    *******************************************************************************
  2130. ***************
  2131. *** 13,18 ****
  2132. --- 13,30 ----
  2133.    *
  2134.    *******************************************************************************
  2135.    * $Log: getword.c,v $
  2136. +  * Revision 5.2  1993/08/03  19:28:39  syd
  2137. +  * Elm tries to replace the system toupper() and tolower() on current
  2138. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2139. +  * collide during linking with routines in isctype.o.  This patch adds
  2140. +  * a Configure test to determine whether replacements are really needed
  2141. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2142. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2143. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2144. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2145. +  * were dropped.
  2146. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2147. +  *
  2148.    * Revision 5.1  1993/01/19  04:46:21  syd
  2149.    * Initial Checkin
  2150.    *
  2151. ***************
  2152. *** 20,26 ****
  2153.    ******************************************************************************/
  2154.   
  2155.   #include <stdio.h>
  2156. - #include <ctype.h>
  2157.   #include "defs.h"
  2158.   
  2159.   int get_word(buffer, start, word, wordlen)
  2160. --- 32,37 ----
  2161.  
  2162. Index: lib/header_cmp.c
  2163. Prereq: 5.2
  2164. *** ../elm2.4/lib/header_cmp.c    Sat Nov  7 15:59:52 1992
  2165. --- lib/header_cmp.c    Tue Aug  3 15:28:50 1993
  2166. ***************
  2167. *** 1,7 ****
  2168. ! static char rcsid[] = "@(#)$Id: header_cmp.c,v 5.2 1992/11/07 20:59:49 syd Exp $";
  2169.   
  2170.   /*******************************************************************************
  2171. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  2172.    *
  2173.    *            Copyright (c) 1988-1992 USENET Community Trust
  2174.    *            Copyright (c) 1986,1987 Dave Taylor
  2175. --- 1,7 ----
  2176. ! static char rcsid[] = "@(#)$Id: header_cmp.c,v 5.3 1993/08/03 19:28:39 syd Exp $";
  2177.   
  2178.   /*******************************************************************************
  2179. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  2180.    *
  2181.    *            Copyright (c) 1988-1992 USENET Community Trust
  2182.    *            Copyright (c) 1986,1987 Dave Taylor
  2183. ***************
  2184. *** 13,18 ****
  2185. --- 13,30 ----
  2186.    *
  2187.    *******************************************************************************
  2188.    * $Log: header_cmp.c,v $
  2189. +  * Revision 5.3  1993/08/03  19:28:39  syd
  2190. +  * Elm tries to replace the system toupper() and tolower() on current
  2191. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2192. +  * collide during linking with routines in isctype.o.  This patch adds
  2193. +  * a Configure test to determine whether replacements are really needed
  2194. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2195. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2196. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2197. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2198. +  * were dropped.
  2199. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2200. +  *
  2201.    * Revision 5.2  1992/11/07  20:59:49  syd
  2202.    * fix typo
  2203.    *
  2204. ***************
  2205. *** 32,42 ****
  2206.   **/
  2207.   
  2208.   #include "headers.h"
  2209. - #include <ctype.h>
  2210. - #ifdef BSD
  2211. - #undef tolower
  2212. - #endif
  2213.   
  2214.   
  2215.   char *
  2216. --- 44,49 ----
  2217.  
  2218. Index: lib/istrcmp.c
  2219. Prereq: 5.1
  2220. *** ../elm2.4/lib/istrcmp.c    Sat Oct  3 18:42:24 1992
  2221. --- lib/istrcmp.c    Tue Aug  3 15:28:51 1993
  2222. ***************
  2223. *** 1,7 ****
  2224. ! static char rcsid[] = "@(#)$Id: istrcmp.c,v 5.1 1992/10/03 22:41:36 syd Exp $";
  2225.   
  2226.   /*******************************************************************************
  2227. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  2228.    *
  2229.    *            Copyright (c) 1988-1992 USENET Community Trust
  2230.    *            Copyright (c) 1986,1987 Dave Taylor
  2231. --- 1,7 ----
  2232. ! static char rcsid[] = "@(#)$Id: istrcmp.c,v 5.2 1993/08/03 19:28:39 syd Exp $";
  2233.   
  2234.   /*******************************************************************************
  2235. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  2236.    *
  2237.    *            Copyright (c) 1988-1992 USENET Community Trust
  2238.    *            Copyright (c) 1986,1987 Dave Taylor
  2239. ***************
  2240. *** 13,18 ****
  2241. --- 13,30 ----
  2242.    *
  2243.    *******************************************************************************
  2244.    * $Log: istrcmp.c,v $
  2245. +  * Revision 5.2  1993/08/03  19:28:39  syd
  2246. +  * Elm tries to replace the system toupper() and tolower() on current
  2247. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2248. +  * collide during linking with routines in isctype.o.  This patch adds
  2249. +  * a Configure test to determine whether replacements are really needed
  2250. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2251. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2252. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2253. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2254. +  * were dropped.
  2255. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2256. +  *
  2257.    * Revision 5.1  1992/10/03  22:41:36  syd
  2258.    * Initial checkin as of 2.4 Release at PL0
  2259.    *
  2260. ***************
  2261. *** 24,35 ****
  2262.   **/
  2263.   
  2264.   #include "headers.h"
  2265. - #include <ctype.h>
  2266. - #ifdef BSD
  2267. - #undef tolower
  2268. - #endif
  2269.   
  2270.   int
  2271.   istrcmp(s1,s2)
  2272. --- 36,41 ----
  2273. ***************
  2274. *** 38,45 ****
  2275.       /* case insensitive comparison */
  2276.       register int d;
  2277.       for (;;) {
  2278. !       d = ( isupper(*s1) ? tolower(*s1) : *s1 )
  2279. !           - ( isupper(*s2) ? tolower(*s2) : *s2 ) ;
  2280.         if ( d != 0 || *s1 == '\0' || *s2 == '\0' )
  2281.           return d;
  2282.         ++s1;
  2283. --- 44,50 ----
  2284.       /* case insensitive comparison */
  2285.       register int d;
  2286.       for (;;) {
  2287. !       d = (tolower(*s1) - tolower(*s2));
  2288.         if ( d != 0 || *s1 == '\0' || *s2 == '\0' )
  2289.           return d;
  2290.         ++s1;
  2291.  
  2292. Index: lib/ldstate.c
  2293. Prereq: 5.5
  2294. *** ../elm2.4/lib/ldstate.c    Wed Feb  3 10:26:31 1993
  2295. --- lib/ldstate.c    Sun Aug 22 22:46:53 1993
  2296. ***************
  2297. *** 1,8 ****
  2298.   
  2299. ! static char rcsid[] = "@(#)$Id: ldstate.c,v 5.5 1993/02/03 15:26:13 syd Exp $";
  2300.   
  2301.   /*******************************************************************************
  2302. !  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
  2303.    *
  2304.    *            Copyright (c) 1992 USENET Community Trust
  2305.    *******************************************************************************
  2306. --- 1,8 ----
  2307.   
  2308. ! static char rcsid[] = "@(#)$Id: ldstate.c,v 5.6 1993/08/23 02:46:51 syd Exp $";
  2309.   
  2310.   /*******************************************************************************
  2311. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  2312.    *
  2313.    *            Copyright (c) 1992 USENET Community Trust
  2314.    *******************************************************************************
  2315. ***************
  2316. *** 13,18 ****
  2317. --- 13,22 ----
  2318.    *
  2319.    *******************************************************************************
  2320.    * $Log: ldstate.c,v $
  2321. +  * Revision 5.6  1993/08/23  02:46:51  syd
  2322. +  * Test ANSI_C, not __STDC__ (which is not set on e.g. AIX).
  2323. +  * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
  2324. +  *
  2325.    * Revision 5.5  1993/02/03  15:26:13  syd
  2326.    * protect atol in ifndef __STDC__ as some make it a macro, and its in stdlib.h
  2327.    *
  2328. ***************
  2329. *** 57,64 ****
  2330.    * the (struct folder_state) record.
  2331.    */
  2332.   
  2333. ! #ifndef __STDC__ /* avoid problemswith systems that declare atol as a macro */
  2334. !     extern long atol();
  2335.   #endif
  2336.   
  2337.   static char *elm_fgetline(buf, buflen, fp)
  2338. --- 61,68 ----
  2339.    * the (struct folder_state) record.
  2340.    */
  2341.   
  2342. ! #if !ANSI_C  /* avoid problems with systems that declare atol as a macro */
  2343. ! extern long atol();
  2344.   #endif
  2345.   
  2346.   static char *elm_fgetline(buf, buflen, fp)
  2347.  
  2348. Index: lib/len_next.c
  2349. Prereq: 5.4
  2350. *** ../elm2.4/lib/len_next.c    Sun Apr 11 21:27:30 1993
  2351. --- lib/len_next.c    Tue Aug  3 15:28:51 1993
  2352. ***************
  2353. *** 1,8 ****
  2354.   
  2355. ! static char rcsid[] = "@(#)$Id: len_next.c,v 5.4 1993/04/12 01:27:30 syd Exp $";
  2356.   
  2357.   /*******************************************************************************
  2358. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  2359.    *
  2360.    *             Copyright (c) 1992 USENET Community Trust
  2361.    *******************************************************************************
  2362. --- 1,8 ----
  2363.   
  2364. ! static char rcsid[] = "@(#)$Id: len_next.c,v 5.5 1993/08/03 19:28:39 syd Exp $";
  2365.   
  2366.   /*******************************************************************************
  2367. !  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
  2368.    *
  2369.    *             Copyright (c) 1992 USENET Community Trust
  2370.    *******************************************************************************
  2371. ***************
  2372. *** 13,18 ****
  2373. --- 13,30 ----
  2374.    *
  2375.    *******************************************************************************
  2376.    * $Log: len_next.c,v $
  2377. +  * Revision 5.5  1993/08/03  19:28:39  syd
  2378. +  * Elm tries to replace the system toupper() and tolower() on current
  2379. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2380. +  * collide during linking with routines in isctype.o.  This patch adds
  2381. +  * a Configure test to determine whether replacements are really needed
  2382. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2383. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2384. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2385. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2386. +  * were dropped.
  2387. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2388. +  *
  2389.    * Revision 5.4  1993/04/12  01:27:30  syd
  2390.    * len_next_part() was botching quote-delimited strings.
  2391.    * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2392. ***************
  2393. *** 54,61 ****
  2394.   
  2395.   **/
  2396.   
  2397. - #include <ctype.h>
  2398.   
  2399.   int
  2400.   len_next_part(str)
  2401. --- 66,71 ----
  2402.  
  2403. Index: lib/mail_gets.c
  2404. Prereq: 5.2
  2405. *** ../elm2.4/lib/mail_gets.c    Sun Apr 11 21:13:30 1993
  2406. --- lib/mail_gets.c    Tue Aug  3 15:28:52 1993
  2407. ***************
  2408. *** 1,8 ****
  2409.   
  2410. ! static char rcsid[] = "@(#)$Id: mail_gets.c,v 5.2 1993/04/12 01:13:30 syd Exp $";
  2411.   
  2412.   /*******************************************************************************
  2413. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  2414.    *
  2415.    *             Copyright (c) 1992 USENET Community Trust
  2416.    *******************************************************************************
  2417. --- 1,8 ----
  2418.   
  2419. ! static char rcsid[] = "@(#)$Id: mail_gets.c,v 5.4 1993/08/03 19:28:39 syd Exp $";
  2420.   
  2421.   /*******************************************************************************
  2422. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  2423.    *
  2424.    *             Copyright (c) 1992 USENET Community Trust
  2425.    *******************************************************************************
  2426. ***************
  2427. *** 13,18 ****
  2428. --- 13,39 ----
  2429.    *
  2430.    *******************************************************************************
  2431.    * $Log: mail_gets.c,v $
  2432. +  * Revision 5.4  1993/08/03  19:28:39  syd
  2433. +  * Elm tries to replace the system toupper() and tolower() on current
  2434. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2435. +  * collide during linking with routines in isctype.o.  This patch adds
  2436. +  * a Configure test to determine whether replacements are really needed
  2437. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2438. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2439. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2440. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2441. +  * were dropped.
  2442. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2443. +  *
  2444. +  * Revision 5.3  1993/08/03  19:05:33  syd
  2445. +  * When STDC is used on Convex the feof() function is defined as
  2446. +  * a true library routine in the header files and moreover the
  2447. +  * library routine also leaks royally. It returns always 1!!
  2448. +  * So we have to use a macro. Convex naturally does not provide
  2449. +  * you with one though if you are using a STDC compiler. So we
  2450. +  * have to include one.
  2451. +  * From: Jukka Ukkonen <ukkonen@csc.fi>
  2452. +  *
  2453.    * Revision 5.2  1993/04/12  01:13:30  syd
  2454.    * In some cases, with certain editors, the user can create an
  2455.    * aliases.text file in which the last line is terminated with an EOF but
  2456. ***************
  2457. *** 33,40 ****
  2458.   **/
  2459.   
  2460.   #include <stdio.h>
  2461. ! #include <ctype.h>
  2462.   
  2463.   int
  2464.   mail_gets(buffer, size, mailfile)
  2465. --- 54,60 ----
  2466.   **/
  2467.   
  2468.   #include <stdio.h>
  2469. ! #include "defs.h"
  2470.   
  2471.   int
  2472.   mail_gets(buffer, size, mailfile)
  2473. ***************
  2474. *** 46,51 ****
  2475. --- 66,72 ----
  2476.       register char *c = buffer;
  2477.   
  2478.       size--; /* allow room for zero terminator on end, just in case */
  2479.       while (!feof(mailfile) && !ferror(mailfile) && line_bytes < size) {
  2480.         ch = getc(mailfile); /* Macro, faster than  fgetc() ! */
  2481.   
  2482.  
  2483. Index: lib/mcprt.c
  2484. *** ../elm2.4/lib/mcprt.c    Sat Oct  3 18:42:25 1992
  2485. --- lib/mcprt.c    Sun Aug 22 22:49:36 1993
  2486. ***************
  2487. *** 1,4 ****
  2488. --- 1,6 ----
  2489.   
  2490. + static char rcsid[] = "@(#)$Id: mcprt.c,v 5.5 1993/08/23 02:49:35 syd Exp $";
  2491.   /***********************************************************
  2492.   Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
  2493.   
  2494. ***************
  2495. *** 35,41 ****
  2496.   
  2497.   01/18/91   3 hamilton    #if not rescanned
  2498.   01/12/91   1 schulert    conditionally use prototypes
  2499. !             rework to use either varargs or stdargs
  2500.   11/03/90   2 hamilton    Alphalpha->Alfalfa & OmegaMail->Poste
  2501.   08/10/90   1 nazgul    printf, sprintf and fprintf
  2502.   */
  2503. --- 37,43 ----
  2504.   
  2505.   01/18/91   3 hamilton    #if not rescanned
  2506.   01/12/91   1 schulert    conditionally use prototypes
  2507. !             rework to use either varargs or stdarg
  2508.   11/03/90   2 hamilton    Alphalpha->Alfalfa & OmegaMail->Poste
  2509.   08/10/90   1 nazgul    printf, sprintf and fprintf
  2510.   */
  2511. ***************
  2512. *** 47,55 ****
  2513. --- 49,61 ----
  2514.   #include "mcprt.h"
  2515.   #include "mcprtlib.h"
  2516.   
  2517. + #ifdef    I_STDARG
  2518. + int    MCprintf(char *fmt, ...)
  2519. + #else
  2520.   int    MCprintf(fmt, va_alist)
  2521.   char *fmt;
  2522.   va_dcl
  2523. + #endif
  2524.   {
  2525.       MCRockT    *rock;
  2526.       int        len, i;
  2527. ***************
  2528. *** 65,74 ****
  2529. --- 71,84 ----
  2530.       return len;
  2531.   }
  2532.   
  2533. + #ifdef    I_STDARG
  2534. + int    MCfprintf(FILE *fptr, char *fmt, ...)
  2535. + #else
  2536.   int    MCfprintf(fptr, fmt, va_alist)
  2537.   FILE *fptr;
  2538.   char *fmt;
  2539.   va_dcl
  2540. + #endif
  2541.   {
  2542.       MCRockT    *rock;
  2543.       int        len, i;
  2544. ***************
  2545. *** 84,93 ****
  2546. --- 94,107 ----
  2547.       return len;
  2548.   }
  2549.   
  2550. + #ifdef    I_STDARG
  2551. + int    MCsprintf(char *cptr, char *fmt, ...)
  2552. + #else
  2553.   int    MCsprintf(cptr, fmt, va_alist)
  2554.   char *cptr;
  2555.   char *fmt;
  2556.   va_dcl
  2557. + #endif
  2558.   {
  2559.       MCRockT    *rock;
  2560.       int        len, i;
  2561.  
  2562. Index: lib/mcprtlib.c
  2563. *** ../elm2.4/lib/mcprtlib.c    Sat Oct  3 18:42:26 1992
  2564. --- lib/mcprtlib.c    Sun Aug 22 22:54:32 1993
  2565. ***************
  2566. *** 1,4 ****
  2567. --- 1,6 ----
  2568.   
  2569. + static char rcsid[] = "@(#)$Id: mcprtlib.c,v 5.5 1993/08/23 02:54:31 syd Exp $";
  2570.   /***********************************************************
  2571.   Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
  2572.   
  2573. ***************
  2574. *** 47,53 ****
  2575.   #define    CATGETS
  2576.   
  2577.   #include <stdio.h>
  2578. - #include <ctype.h>
  2579.   #include "defs.h"
  2580.   
  2581.   #include "mcprtlib.h"
  2582. --- 49,54 ----
  2583. ***************
  2584. *** 292,297 ****
  2585. --- 293,302 ----
  2586.        * Set the correct types and figure out how many data segments we are going
  2587.        * to have.
  2588.        */
  2589. +     /* Initialize typeList */
  2590. +     for (i = 0; i < typeCnt; i++)
  2591. +       typeList[i].type = 0;
  2592.       for (replyCnt = i = 0; i < argCnt; ++i) {
  2593.       if (argList[i].type) {
  2594.           pos = argList[i].pos-1;
  2595. ***************
  2596. *** 580,586 ****
  2597.       if (rock->typeList) free((char *) rock->typeList);
  2598.       
  2599.       if (rock->replyList) {
  2600. !     for (i = 0; i < rock->argCnt; ++i) {
  2601.           if ((rock->replyList[i].argType & MCFree) && rock->replyList[i].data)
  2602.             free(rock->replyList[i].data);
  2603.       }
  2604. --- 585,591 ----
  2605.       if (rock->typeList) free((char *) rock->typeList);
  2606.       
  2607.       if (rock->replyList) {
  2608. !     for (i = 0; i < rock->replyCnt; ++i) {
  2609.           if ((rock->replyList[i].argType & MCFree) && rock->replyList[i].data)
  2610.             free(rock->replyList[i].data);
  2611.       }
  2612.  
  2613.